home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Transmission / whiteline CD Series - Transmission.iso / utilitys / rezfool / rtfsetu3.s < prev    next >
Text File  |  1995-06-07  |  53KB  |  2,851 lines

  1. *
  2. * Standard routine for GEM programs, by WtP (some help from Abacus GEM PR)
  3. *
  4. * Supports shared memory
  5. *
  6.  
  7. editfile        EQU        0
  8.  
  9. write_it    EQU        1
  10. info_file    EQU        2
  11. edit_mem    EQU        3
  12. want_rgb_file    EQU        4
  13. want_tv_file    EQU        5
  14. got_vga_file    EQU        6
  15. got_rgb_file    EQU        8
  16. got_tv_file    EQU        9
  17.  
  18. editmem            EQU        1
  19.  
  20. reset        EQU        1
  21. edit_file    EQU        2
  22. fool_rgb_mem    EQU        3
  23. fool_tv_mem    EQU        4
  24. got_vga_mem    EQU        5
  25. got_rgb_mem    EQU        7
  26. got_tv_mem    EQU        8
  27. info_edit    EQU       11
  28.  
  29. info_form        EQU        2
  30.  
  31. exit_info    EQU        1
  32. show_me        EQU       12
  33.  
  34. menu            EQU        3
  35.  
  36. desk_menu    EQU        3
  37. edit_menu    EQU        4
  38. misc_menu    EQU        5
  39. about        EQU        8
  40. edit_mem_menu    EQU       17
  41. edit_file_menu    EQU       18
  42. quit_menu    EQU       20
  43. write_menu    EQU       21
  44. reset_menu    EQU       22
  45.  
  46. unknown_path        EQU        4
  47.  
  48. ok_unknow_p    EQU        1
  49.  
  50. write_e            EQU        5
  51.  
  52. ok_write_e    EQU        1
  53.  
  54. faked            EQU        6
  55.  
  56. ok_faked    EQU        1
  57.  
  58. good_write        EQU        7
  59.  
  60. write_good    EQU        1
  61.  
  62. shower            EQU        8
  63.  
  64. will        EQU        1
  65.  
  66. *        opt X+                *long symbols for debugging
  67.  
  68. text:        bra    starter
  69.  
  70.         dc.b    "This program written by Pontus Sköld aka WtP of Section One ... "
  71.         dc.b    "Ryllshyttan 1, 776 98 Garpenberg, Sweden ... Send me a postcard ..."
  72.  
  73.         even
  74.  
  75. starter:    move.l    sp,d0
  76.         bne.s    got_stack
  77.  
  78.         move.l    a0,a6
  79.         bra.s    dont_read_bp_adr
  80. got_stack:
  81.         move.l    4(sp),a6
  82.  
  83. dont_read_bp_adr:
  84.         movea.l    16(a6),a4        *address to data segment
  85.         movea.l    24(a6),a5        *and to bss segment
  86.  
  87.         move.l    12(a6),d0
  88.         add.l    20(a6),d0
  89.         add.l    28(a6),d0
  90.  
  91.         add.l    #$1400,d0
  92.  
  93.         lea    stack-bss(a5),sp
  94.  
  95.         move.l    d0,-(sp)
  96.         move.l    a6,-(sp)
  97.         clr.w    -(sp)
  98.         move.w    #$4a,-(sp)
  99.         trap    #1
  100.         lea    12(sp),sp
  101.  
  102.         bsr    init_once    *setup variables one time only
  103.  
  104.         tst.w    acc_load-bss(a5)
  105.         bne    acc_mode
  106.  
  107.         moveq    #0,d0
  108.         bsr    graf_mouse
  109.  
  110.         move.l    tree_pointer-bss(a5),a0
  111.         move.l    menu*4(a0),a0
  112.  
  113.         moveq    #1,d0
  114.  
  115.         bsr    menu_bar
  116.  
  117.  
  118.  
  119. start_acc_run:    bsr    popup_window
  120.  
  121.         cmp.l    #4*editmem,rcs_screen-bss(a5)
  122.         beq    update_mem_screen
  123.  
  124.         cmp.l    #4*editfile,rcs_screen-bss(a5)
  125.         beq    update_file_screen
  126.  
  127.         bsr    send_redraw
  128. window_handling_loop:
  129.         bsr    check_rezf
  130.  
  131.         bsr    init_em_parameters
  132.  
  133.         lea    em_buffer-bss(a5),a0
  134.  
  135.         bsr    setup_em_mesag
  136.         bsr    setup_em_keyboard
  137.  
  138.         moveq    #2,d0
  139.         moveq    #1,d1
  140.         moveq    #1,d2
  141.  
  142.         bsr    setup_em_button
  143.         bsr    do_evnt_multi
  144.  
  145. return_from_evnt:
  146.         cmp.w    #1,d0
  147.         bne    not_keyboard_event
  148.  
  149.         cmp.b    #13,intout+11-bss(a5)        *return or enter
  150.         bne    not_keyboard_event
  151.  
  152.         move.l    rcs_screen-bss(a5),d0
  153.         lsr.l    #1,d0
  154.  
  155.         lea    default_list-bss(a5),a0
  156.  
  157.         move.w    0(a0,d0.w),d0
  158.         bpl    object_selected
  159.         bra    window_handling_loop
  160.  
  161. not_keyboard_event:
  162.         cmp.w    #2,d0
  163.         bne    not_mouse_button
  164.  
  165. *        bsr    init_em_parameters    *Touch exit on everything
  166.  
  167. *        moveq    #1,d0
  168. *        moveq    #1,d1
  169. *        moveq    #0,d2
  170.  
  171. *        bsr    setup_em_button
  172. *        bsr    do_evnt_multi
  173.  
  174.         move.w    intout+2-bss(a5),d6
  175.         sub.w    work_x-bss(a5),d6
  176.  
  177.         move.w    intout+4-bss(a5),d7
  178.         sub.w    work_y-bss(a5),d7
  179.  
  180.         tst.w    d6
  181.         bmi    not_mouse_button
  182.  
  183.         tst.w    d7
  184.         bmi    not_mouse_button
  185.  
  186.         cmp.w    work_w-bss(a5),d6
  187.         bpl    not_mouse_button
  188.  
  189.         cmp.w    work_h-bss(a5),d7
  190.         bpl    not_mouse_button
  191.  
  192.         move.w    intout+12-bss(a5),d0
  193.  
  194.         cmp.w    #2,d0
  195.         bne    not_toggle_screens
  196.  
  197.         tst.l    text_adr-bss(a5)
  198.         bne    toggle_screens
  199.  
  200.         cmp.l    #editfile*4,rcs_screen-bss(a5)
  201.         bne    toggle_screens
  202.  
  203.         bra    window_handling_loop
  204.  
  205. not_toggle_screens:
  206.         moveq    #0,d0            *start with object null
  207.         moveq    #7,d1            *7 levels
  208.  
  209.         move.w    intout+2-bss(a5),d2    *mouse x
  210.         move.w    intout+4-bss(a5),d3    *mouse y
  211.  
  212.         move.l    tree_pointer-bss(a5),a0
  213.         add.l    rcs_screen-bss(a5),a0
  214.         move.l    (a0),a0
  215.  
  216.         bsr    objc_find
  217.  
  218.         tst.w    d0
  219.         bmi    window_handling_loop
  220.  
  221.         move.l    tree_pointer-bss(a5),a0
  222.         add.l    rcs_screen-bss(a5),a0
  223.         move.l    (a0),a0
  224.         
  225.         move.l    d0,d2
  226.         mulu    #24,d2
  227.  
  228.         move.w    8(a0,d2.l),d1
  229.  
  230.         and.w    #%1000101,d1
  231.  
  232.         btst    #0,d1            *not selectable, nothing to
  233.         beq    window_handling_loop    *care about
  234.  
  235.         btst    #2,d1
  236.         beq    window_handling_loop
  237.  
  238.         btst    #6,d1            *if touchexit, goto object selected
  239.         bne    object_selected
  240.  
  241.         move.l    tree_pointer-bss(a5),a0
  242.         add.l    rcs_screen-bss(a5),a0
  243.         move.l    (a0),a0
  244.  
  245.         move.w    10(a0,d2.l),d5        *get old status
  246.         or.w    #1,d5            *highlighted
  247.         
  248.         move.w    work_x-bss(a5),d1
  249.         move.w    work_y-bss(a5),d2
  250.         move.w    work_w-bss(a5),d3
  251.         move.w    work_h-bss(a5),d4
  252.  
  253.         moveq    #0,d7
  254.         move.w    d0,d7
  255.  
  256.         moveq    #1,d6
  257.         bsr    objc_change
  258.  
  259.         move.l    d7,d0
  260.  
  261.         move.l    tree_pointer-bss(a5),a0
  262.         add.l    rcs_screen-bss(a5),a0
  263.         move.l    (a0),a0
  264.         
  265.         bsr    objc_offset
  266.  
  267.         move.w    intout+2-bss(a5),d1    *get x &?Γúµ?s
  268.         move.w    intout+4-bss(a5),d2    *for object...
  269.  
  270.         bsr    init_em_parameters
  271.  
  272.         move.l    d7,d0
  273.         mulu    #24,d0
  274.  
  275.         move.l    tree_pointer-bss(a5),a0
  276.         add.l    rcs_screen-bss(a5),a0
  277.         move.l    (a0),a0
  278.  
  279.         move.w    20(a0,d0.l),d3
  280.         move.w    22(a0,d0.l),d4
  281.  
  282.         moveq    #1,d0
  283.         bsr    setup_em_mouse1
  284.  
  285.         moveq    #1,d0                *max 1 click
  286.         moveq    #1,d1                *only left counts
  287.         moveq    #0,d2                *until release...
  288.  
  289.         bsr    setup_em_button
  290.  
  291.         bsr    do_evnt_multi
  292.  
  293.         move.w    d0,-(sp)        *save intout 0...
  294.  
  295.         move.l    d7,d0            *object #
  296.         mulu    #24,d0
  297.  
  298.         move.l    tree_pointer-bss(a5),a0
  299.         add.l    rcs_screen-bss(a5),a0
  300.         move.l    (a0),a0
  301.         
  302.         move.w    work_x-bss(a5),d1
  303.         move.w    work_y-bss(a5),d2
  304.         move.w    work_w-bss(a5),d3
  305.         move.w    work_h-bss(a5),d4
  306.  
  307.         move.w    10(a0,d0.l),d5        *get old status
  308.         and.w    #$fffe,d5        *not highlighted
  309.  
  310.         move.l    d7,d0
  311.  
  312.         moveq    #1,d6
  313.         bsr    objc_change
  314.  
  315.         move.w    (sp)+,d1
  316.         move.l    d7,d0
  317.  
  318.         btst    #1,d1            *if it was mouse released
  319.         bne    object_selected        *go to object_selected
  320.  
  321.         bra    window_handling_loop
  322.  
  323. not_mouse_button:
  324.         cmp.w    #$10,d0
  325.         bne    window_handling_loop
  326.  
  327.         move.w    em_buffer+4-bss(a5),d1
  328.         beq.s    not_read_more
  329.  
  330.         move.w    appl_id-bss(a5),d0
  331.  
  332.         lea    em_buffer+16-bss(a5),a0
  333.  
  334.         bsr    appl_read
  335.  
  336. not_read_more:
  337. *        move.w    appl_id-bss(a5),d0        *???
  338. *        cmp.w    em_buffer+2-bss(a5),d0
  339. *        bne    window_handling_loop
  340.  
  341.         move.w    em_buffer-bss(a5),d0
  342.  
  343.         cmp.w    #10,d0
  344.         beq    menu_options
  345.  
  346.         cmp.w    #41,d0
  347.         bne.s    not_ac_close
  348.  
  349.         move.w    em_buffer+6-bss(a5),d1
  350.         cmp.w    desk_id-bss(a5),d1
  351.         beq    delete_window_and_exit
  352.  
  353. not_ac_close:    cmp.w    #"RF",d0
  354.         beq    message_to_me
  355.  
  356.         move.w    window_handle-bss(a5),d1
  357.         cmp.w    em_buffer+6-bss(a5),d1
  358.         bne    window_handling_loop
  359.     
  360.         cmp.w    #22,d0            *wm_close
  361.         beq    close_window_and_exit
  362.  
  363.         cmp.w    #20,d0            *wm_update
  364.         beq    update_screen
  365.  
  366.         cmp.w    #21,d0            *wm_top
  367.         beq    top_my_window
  368.  
  369.         cmp.w    #10,d0
  370.         beq    menu_options
  371.  
  372.         cmp.w    #28,d0            *wm_moved
  373.         bne    window_handling_loop
  374.  
  375.         move.w    em_buffer+8-bss(a5),window_x-bss(a5)    *read new
  376.         move.w    em_buffer+10-bss(a5),window_y-bss(a5)    *pos
  377.         move.w    em_buffer+12-bss(a5),window_w-bss(a5)
  378.         move.w    em_buffer+14-bss(a5),window_h-bss(a5)
  379.  
  380.  
  381.         move.w    window_handle-bss(a5),d0
  382.         moveq    #5,d1
  383.  
  384.         move.w    window_x-bss(a5),d2
  385.         move.w    window_y-bss(a5),d3
  386.         move.w    window_w-bss(a5),d4
  387.         move.w    window_h-bss(a5),d5
  388.  
  389.         bsr    wind_set
  390.  
  391.         move.w    window_handle-bss(a5),d0    *get workarea
  392.         moveq    #4,d1                *coords
  393.  
  394.         bsr    wind_get
  395.  
  396.         move.w    intout+2-bss(a5),work_x-bss(a5)    *save, so we now it's
  397.         move.w    intout+4-bss(a5),work_y-bss(a5)    *current position
  398.         move.w    intout+6-bss(a5),work_w-bss(a5)
  399.         move.w    intout+8-bss(a5),work_h-bss(a5)
  400.  
  401.         move.l    tree_pointer-bss(a5),a0        *
  402.         add.l    rcs_screen-bss(a5),a0
  403.         move.l    (a0),a0
  404.  
  405.         move.w    work_x-bss(a5),16(a0)    *update tree coordinates
  406.         move.w    work_y-bss(a5),18(a0)
  407.  
  408.         bra    window_handling_loop
  409.  
  410. close_window_and_exit:
  411.         bsr    close_window
  412. delete_window_and_exit:
  413.         bsr    delete_window
  414.         move.w    desk_id-bss(a5),d0
  415.         cmp.w    #"er",d0
  416.         bne    acc_loop
  417. *
  418. * Go look for accs...
  419. *
  420.  
  421. * This only for program ...
  422.  
  423.         moveq    #0,d0            *erase bar
  424.  
  425.         move.l    tree_pointer-bss(a5),a0
  426.         move.l    menu*4(a0),a0
  427.  
  428.         bsr    menu_bar
  429.  
  430. something_wrong:
  431.         bsr    close_virtual
  432.         bsr    appl_exit
  433.  
  434.         moveq    #0,d0
  435.         bra.s    quit_right_now
  436.  
  437.  
  438. acc_mode:    move.w    appl_id-bss(a5),d0
  439.         lea    acc_name-data(a4),a0
  440.  
  441.         bsr    menu_register
  442.  
  443.         tst.w    d0            *if no handle, go something
  444.         bmi    something_wrong        *wrong (exit)
  445.  
  446.         move.w    d0,desk_id-bss(a5)
  447.  
  448. acc_loop:    bsr    init_em_parameters
  449.  
  450.         lea    em_buffer-bss(a5),a0
  451.         bsr    setup_em_mesag
  452.         bsr    do_evnt_multi
  453.  
  454.         cmp.w    #$10,d0
  455.         bne.s    acc_loop
  456.  
  457.         move.w    em_buffer+4-bss(a5),d1
  458.         beq.s    not_read_more2
  459.  
  460.         move.w    appl_id-bss(a5),d0
  461.         lea    em_buffer+16-bss(a5),a0
  462.  
  463.         bsr    appl_read
  464.  
  465. not_read_more2:    cmp.w    #40,em_buffer-bss(a5)
  466.         beq    start_acc_run
  467.  
  468.         move.w    em_buffer+8-bss(a5),d0         *???
  469.         cmp.w    desk_id-bss(a5),d0
  470.         beq    start_acc_run
  471.  
  472.         bra.s    acc_loop
  473.  
  474. auto_load:    move.l    text_adr-bss(a5),d0
  475.         bne    search_command
  476.  
  477. auto_loaded:    pea    no_auto_run-data(a4)
  478.         move.w    #9,-(sp)
  479.         trap    #1
  480.         addq.l    #6,sp
  481.  
  482.         moveq    #-76,d0
  483. quit_right_now:
  484.         move.w    d0,-(sp)
  485.         move.w    #$4c,-(sp)
  486.         trap    #1
  487.  
  488. object_selected:
  489.         cmp.l    #editfile*4,rcs_screen-bss(a5)    *are we in tree 0 ?
  490.         bne    not_on_filescreen
  491.  
  492.         cmp.w    #info_file,d0
  493.         beq    show_info
  494.  
  495.         cmp.w    #want_tv_file,d0
  496.         bne    not_want_tv_file
  497.  
  498.         clr.w    want_file-bss(a5)
  499.         bra    update_file_screen
  500.  
  501. not_want_tv_file:
  502.         cmp.w    #want_rgb_file,d0
  503.         bne    not_want_rgb_file
  504.  
  505.         move.w    #1,want_file-bss(a5)
  506.         bra    update_file_screen
  507.  
  508. not_want_rgb_file:
  509.         cmp.w    #got_tv_file,d0
  510.         bne    not_got_tv_file
  511.  
  512.         clr.w    got_file-bss(a5)
  513.         bra    update_file_screen
  514.  
  515. not_got_tv_file:
  516.         cmp.w    #got_rgb_file,d0
  517.         bne    not_got_rgb_file
  518.  
  519.         move.w    #1,got_file-bss(a5)
  520.         bra    update_file_screen
  521.  
  522. not_got_rgb_file:
  523.         cmp.w    #got_vga_file,d0
  524.         bne    not_got_vga_file
  525.  
  526.         move.w    #2,got_file-bss(a5)
  527.         bra    update_file_screen
  528. not_got_vga_file:
  529.         tst.l    text_adr-bss(a5)
  530.         beq.s    skip_edit_mem_ctrl
  531.  
  532.         cmp.w    #edit_mem,d0
  533.         beq    toggle_screens
  534. skip_edit_mem_ctrl:
  535.         cmp.w    #write_it,d0
  536.         beq    write_to_file
  537.  
  538.         bra    unknown_event
  539.  
  540. not_on_filescreen:
  541.         cmp.l    #editmem*4,rcs_screen-bss(a5)    *are we in tree 1 ?
  542.         bne    not_on_memscreen
  543.  
  544.         cmp.w    #reset,d0
  545.         bne    not_reset_settings
  546.  
  547. reset_sets:    move.l    text_adr-bss(a5),a0
  548.         move.l    save_mem-bss(a5),2(a0)
  549.         bra    update_mem_screen
  550.  
  551. not_reset_settings:
  552.         cmp.w    #info_edit,d0
  553.         beq    show_info
  554.  
  555.         cmp.w    #edit_file,d0
  556.         beq    toggle_screens
  557.  
  558.         move.l    text_adr-bss(a5),a0
  559.  
  560.         cmp.w    #fool_rgb_mem,d0
  561.         bne.s    not_fool_rgb_mem
  562.  
  563.         move.w    #1,4(a0)
  564.         bra    update_mem_screen
  565.  
  566. not_fool_rgb_mem:
  567.         cmp.w    #fool_tv_mem,d0
  568.         bne.s    not_fool_tv_mem
  569.  
  570.         move.w    #3,4(a0)
  571.         bra    update_mem_screen
  572. not_fool_tv_mem:
  573.         cmp.w    #got_rgb_mem,d0
  574.         bne.s    not_got_rgb_mem
  575.  
  576.         move.w    #1,2(a0)
  577.         bra    update_mem_screen
  578.  
  579. not_got_rgb_mem:
  580.         cmp.w    #got_tv_mem,d0
  581.         bne.s    not_got_tv_mem
  582.  
  583.         move.w    #3,2(a0)
  584.         bra    update_mem_screen
  585. not_got_tv_mem:
  586.         cmp.w    #got_vga_mem,d0
  587.         bne.s    not_got_vga_mem
  588.  
  589.         move.w    #2,2(a0)
  590.         bra    update_mem_screen
  591. not_got_vga_mem:
  592.         bra    unknown_event
  593.  
  594. not_on_memscreen:
  595.         cmp.l    #info_form*4,rcs_screen-bss(a5)
  596.         bne    not_on_infoscreen
  597.  
  598.         cmp.w    #exit_info,d0        *we are in tree 2
  599.         beq    toggle_screens        
  600.  
  601.         cmp.w    #show_me,d0        *we are in tree 2
  602.         bne    unknown_event        
  603.  
  604.         move.l    #shower*4,d0
  605.         bra    show_other_box
  606.  
  607. not_on_infoscreen:
  608.         cmp.l    #unknown_path*4,rcs_screen-bss(a5)
  609.         bne    not_on_up_screen
  610.  
  611.         cmp.w    #ok_unknow_p,d0
  612.         beq    toggle_screens
  613.         bra    unknown_event
  614.     
  615. not_on_up_screen:
  616.         cmp.l    #write_e*4,rcs_screen-bss(a5)
  617.         bne    not_on_we_screen
  618.  
  619.         cmp.w    #ok_write_e,d0
  620.         beq    toggle_screens
  621.         bra    unknown_event
  622.     
  623. not_on_we_screen:
  624.         cmp.l    #faked*4,rcs_screen-bss(a5)
  625.         bne    not_on_fv_screen
  626.  
  627.         cmp.w    #ok_faked,d0
  628.         beq    toggle_screens
  629.         bra    unknown_event
  630.     
  631. not_on_fv_screen:
  632.         cmp.l    #good_write*4,rcs_screen-bss(a5)
  633.         bne    not_on_gw_screen
  634.  
  635.         cmp.w    #write_good,d0
  636.         beq    toggle_screens
  637.         bra    unknown_event
  638.     
  639. not_on_gw_screen:
  640.         cmp.l    #shower*4,rcs_screen-bss(a5)
  641.         bne    not_on_secret_screen
  642.  
  643.         cmp.w    #will,d0
  644.         beq    toggle_screens
  645.         bra    unknown_event
  646.     
  647. not_on_secret_screen:
  648.  
  649.  
  650. unknown_event:    bra    window_handling_loop
  651.  
  652. toggle_screens:    move.l    info_temp-bss(a5),d0
  653.         bmi    not_on_info_screen
  654.  
  655.         move.l    info_temp-bss(a5),rcs_screen-bss(a5)
  656.         move.l    #-1,info_temp-bss(a5)
  657.         bra.s    exit_toggle
  658.  
  659. not_on_info_screen:
  660.         tst.l    text_adr-bss(a5)    *if rez fooler not in memory
  661.         beq.s    exit_toggle        *don't allow edit
  662.  
  663.         cmp.l    #editfile*4,rcs_screen-bss(a5)
  664.         beq.s    do_edit_mem
  665.  
  666.         move.l    #editfile*4,rcs_screen-bss(a5)
  667.         bra.s    exit_toggle
  668.  
  669. do_edit_mem:    move.l    #editmem*4,rcs_screen-bss(a5)
  670.         bra.s    exit_toggle
  671.  
  672. show_info:    tst.l    info_temp-bss(a5)
  673.         bpl    window_handling_loop
  674.  
  675.         move.l    rcs_screen-bss(a5),info_temp-bss(a5)
  676.         move.l    #info_form*4,rcs_screen-bss(a5)
  677.  
  678. exit_toggle:    bsr    send_redraw
  679.  
  680.         cmp.l    #editfile*4,rcs_screen-bss(a5)
  681.         beq    update_file_screen
  682.  
  683.         cmp.l    #editmem*4,rcs_screen-bss(a5)
  684.         beq    update_mem_screen
  685.  
  686.         bsr    fix_checkmarks
  687.         bra    window_handling_loop
  688.  
  689. fix_checkmarks:
  690.         move.l    tree_pointer-bss(a5),a0
  691.         move.l    menu*4(a0),a0
  692.  
  693.         move.w    #about,d0
  694.         moveq    #0,d1
  695.  
  696.         bsr    menu_icheck
  697.  
  698.         move.l    tree_pointer-bss(a5),a0
  699.         move.l    menu*4(a0),a0
  700.  
  701.         move.w    #edit_mem_menu,d0
  702.         moveq    #0,d1
  703.  
  704.         bsr    menu_icheck
  705.  
  706.         move.l    tree_pointer-bss(a5),a0
  707.         move.l    menu*4(a0),a0
  708.  
  709.         move.w    #edit_file_menu,d0
  710.         moveq    #0,d1
  711.  
  712.         bsr    menu_icheck
  713.  
  714.         cmp.l    #editfile*4,rcs_screen-bss(a5)
  715.         beq    mark_file
  716.  
  717.         cmp.l    #editmem*4,rcs_screen-bss(a5)
  718.         beq    mark_mem
  719.  
  720.         cmp.l    #info_form*4,rcs_screen-bss(a5)
  721.         bne    no_checkmark
  722.  
  723.         move.l    tree_pointer-bss(a5),a0
  724.         move.l    menu*4(a0),a0
  725.  
  726.         move.w    #about,d0
  727.         moveq    #1,d1
  728.  
  729.         bsr    menu_icheck
  730. no_checkmark:
  731.         rts
  732.  
  733. mark_mem:    move.l    tree_pointer-bss(a5),a0
  734.         move.l    menu*4(a0),a0
  735.  
  736.         move.w    #edit_mem_menu,d0
  737.         moveq    #1,d1
  738.  
  739.         bsr    menu_icheck
  740.         rts
  741.  
  742. mark_file:    move.l    tree_pointer-bss(a5),a0
  743.         move.l    menu*4(a0),a0
  744.  
  745.         move.w    #edit_file_menu,d0
  746.         moveq    #1,d1
  747.  
  748.         bsr    menu_icheck
  749.         rts
  750.  
  751. send_redraw:    move.w    #20,em_buffer-bss(a5)
  752.         move.w    window_handle-bss(a5),em_buffer+6-bss(a5)
  753.         move.w    appl_id-bss(a5),em_buffer+2-bss(a5)
  754.         clr.w    em_buffer+4-bss(a5)
  755.  
  756.         move.w    work_x-bss(a5),em_buffer+8-bss(a5)
  757.         move.w    work_y-bss(a5),em_buffer+10-bss(a5)
  758.         move.w    work_w-bss(a5),em_buffer+12-bss(a5)
  759.         move.w    work_h-bss(a5),em_buffer+14-bss(a5)
  760.  
  761.         move.w    appl_id-bss(a5),d0
  762.         moveq    #16,d1
  763.  
  764.         lea    em_buffer-bss(a5),a0
  765.         bsr    appl_write
  766.         rts
  767.  
  768. message_to_me:    move.w    em_buffer+6-bss(a5),em_buffer+2    *answerback handle
  769.  
  770.         move.w    #"RT",em_buffer-bss(a5)
  771.  
  772.         move.l    text_adr-bss(a5),d6
  773.         bne.s    not_no_rf_loaded
  774.  
  775.         move.w    #-1,em_buffer+6-bss(a5)
  776.         bra    send_answerback
  777. not_no_rf_loaded:
  778.         move.l    d6,a0
  779.  
  780.         move.w    em_buffer+8-bss(a5),d7
  781.         bmi.s    do_not_change_got
  782.  
  783.         move.w    d7,2(a0)
  784. do_not_change_got:
  785.         move.w    2(a0),em_buffer+8-bss(a5)
  786.  
  787.         move.w    em_buffer+10-bss(a5),d7        *check wanted
  788.         bmi.s    do_not_change_want
  789.  
  790.         move.w    d7,4(a0)            *make it true
  791. do_not_change_want:
  792.         move.w    4(a0),em_buffer+10-bss(a5)    *
  793.  
  794.         move.w    6(a0),em_buffer+6-bss(a5)    *version
  795. send_answerback:
  796.         move.w    em_buffer+2-bss(a5),d0
  797.  
  798.         moveq    #16,d1
  799.  
  800.         lea    em_buffer-bss(a5),a0
  801.         bsr    appl_write
  802.         rts
  803.  
  804. update_mem_screen:
  805.         bsr    fix_checkmarks
  806.  
  807.         moveq    #10,d1
  808.         bsr    wind_get
  809.  
  810.         move.w    intout+2-bss(a5),d0
  811.         cmp.w    window_h-bss(a5),d0
  812.         beq.s    draw_boxes_m
  813.  
  814.         cmp.l    #editmem*4,rcs_screen-bss(a5)    *show ???
  815.         bne.s    no_show_mem_set
  816.  
  817.         bsr    send_redraw
  818.         moveq    #0,d6
  819.         bra.s    no_show_mem_set
  820.  
  821. draw_boxes_m:    moveq    #1,d6
  822. no_show_mem_set:
  823.         moveq    #0,d7
  824.  
  825.         move.w    #got_rgb_mem,d0
  826.  
  827.         move.l    text_adr-bss(a5),a3
  828.  
  829.         move.w    work_x-bss(a5),d1
  830.         move.w    work_y-bss(a5),d2
  831.         move.w    work_w-bss(a5),d3
  832.         move.w    work_h-bss(a5),d4
  833.  
  834.         move.l    tree_pointer-bss(a5),a0
  835.         move.l    4*editmem(a0),a0
  836.  
  837.         move.w    d0,d7
  838.         mulu    #24,d7
  839.         move.w    10(a0,d7.l),d5
  840.         and.w    #$fffe,d5
  841.  
  842.         cmp.w    #1,2(a3)
  843.         bne.s    not_mark_rgb3
  844.         or.w    #1,d5
  845. not_mark_rgb3:
  846.         bsr    objc_change
  847.  
  848.         move.w    #got_tv_mem,d0
  849.  
  850.         move.l    tree_pointer-bss(a5),a0
  851.         move.l    editmem*4(a0),a0
  852.  
  853.         move.w    work_x-bss(a5),d1
  854.         move.w    work_y-bss(a5),d2
  855.         move.w    work_w-bss(a5),d3
  856.         move.w    work_h-bss(a5),d4
  857.  
  858.         move.w    d0,d7
  859.         mulu    #24,d7
  860.         move.w    10(a0,d7.l),d5
  861.         and.w    #$fffe,d5
  862.  
  863.         cmp.w    #3,2(a3)
  864.         bne.s    not_mark_tv3
  865.         or.w    #1,d5
  866.  
  867. not_mark_tv3:    bsr    objc_change
  868.  
  869.         move.w    #got_vga_mem,d0
  870.  
  871.         move.l    tree_pointer-bss(a5),a0
  872.         move.l    editmem*4(a0),a0
  873.  
  874.         move.w    work_x-bss(a5),d1
  875.         move.w    work_y-bss(a5),d2
  876.         move.w    work_w-bss(a5),d3
  877.         move.w    work_h-bss(a5),d4
  878.  
  879.         move.w    d0,d7
  880.         mulu    #24,d7
  881.         move.w    10(a0,d7.l),d5
  882.         and.w    #$fffe,d5
  883.  
  884.         cmp.w    #2,2(a3)
  885.         bne.s    not_mark_vga3
  886.         or.w    #1,d5
  887. not_mark_vga3:
  888.         bsr    objc_change
  889.  
  890.         move.w    #fool_rgb_mem,d0
  891.  
  892.         move.l    tree_pointer-bss(a5),a0
  893.         move.l    editmem*4(a0),a0
  894.  
  895.         move.w    work_x-bss(a5),d1
  896.         move.w    work_y-bss(a5),d2
  897.         move.w    work_w-bss(a5),d3
  898.         move.w    work_h-bss(a5),d4
  899.  
  900.         move.w    d0,d7
  901.         mulu    #24,d7
  902.         move.w    10(a0,d7.l),d5
  903.         and.w    #$fffe,d5
  904.  
  905.         cmp.w    #1,4(a3)
  906.         bne.s    not_mark_rgb_w3
  907.         or.w    #1,d5
  908. not_mark_rgb_w3:
  909.         bsr    objc_change
  910.  
  911.         move.w    #fool_tv_mem,d0
  912.  
  913.         move.l    tree_pointer-bss(a5),a0
  914.         move.l    editmem*4(a0),a0
  915.  
  916.         move.w    work_x-bss(a5),d1
  917.         move.w    work_y-bss(a5),d2
  918.         move.w    work_w-bss(a5),d3
  919.         move.w    work_h-bss(a5),d4
  920.  
  921.         move.w    d0,d7
  922.         mulu    #24,d7
  923.         move.w    10(a0,d7.l),d5
  924.         and.w    #$fffe,d5
  925.  
  926.         cmp.w    #3,4(a3)
  927.         bne.s    not_mark_tv_w3
  928.         or.w    #1,d5
  929. not_mark_tv_w3:
  930.         bsr    objc_change
  931.  
  932.         bra    window_handling_loop
  933.  
  934.  
  935. update_file_screen:
  936.         bsr    fix_checkmarks
  937.  
  938.         moveq    #10,d1
  939.         bsr    wind_get
  940.  
  941.         move.w    intout+2-bss(a5),d0
  942.         cmp.w    window_h-bss(a5),d0
  943.         beq.s    draw_boxes_f
  944.  
  945.         cmp.l    #editfile*4,rcs_screen-bss(a5)    *show ???
  946.         bne.s    no_show_file_set
  947.  
  948.         bsr    send_redraw
  949.         moveq    #0,d6
  950.         bra.s    no_show_file_set
  951.  
  952. draw_boxes_f:    moveq    #1,d6
  953. no_show_file_set:
  954.  
  955.         moveq    #0,d7
  956.  
  957.         move.w    #got_rgb_file,d0
  958.  
  959.         move.l    tree_pointer-bss(a5),a3
  960.         move.l    editfile*4(a3),a0
  961.  
  962.         move.w    work_x-bss(a5),d1
  963.         move.w    work_y-bss(a5),d2
  964.         move.w    work_w-bss(a5),d3
  965.         move.w    work_h-bss(a5),d4
  966.  
  967.         move.w    d0,d7
  968.         mulu    #24,d7
  969.         move.w    10(a0,d7.l),d5
  970.         and.w    #$fffe,d5
  971.  
  972.         cmp.w    #1,got_file-bss(a5)
  973.         bne.s    not_mark_rgb
  974.         or.w    #1,d5
  975. not_mark_rgb:
  976.         bsr    objc_change
  977.  
  978.         move.w    #got_tv_file,d0
  979.  
  980.         move.l    editfile*4(a3),a0
  981.  
  982.         move.w    work_x-bss(a5),d1
  983.         move.w    work_y-bss(a5),d2
  984.         move.w    work_w-bss(a5),d3
  985.         move.w    work_h-bss(a5),d4
  986.  
  987.         move.w    d0,d7
  988.         mulu    #24,d7
  989.         move.w    10(a0,d7.l),d5
  990.         and.w    #$fffe,d5
  991.  
  992.         tst.w    got_file-bss(a5)
  993.         bne.s    not_mark_tv
  994.         or.w    #1,d5
  995. not_mark_tv:
  996.         bsr    objc_change
  997.  
  998.         move.w    #got_vga_file,d0
  999.  
  1000.         move.l    editfile*4(a3),a0
  1001.  
  1002.         move.w    work_x-bss(a5),d1
  1003.         move.w    work_y-bss(a5),d2
  1004.         move.w    work_w-bss(a5),d3
  1005.         move.w    work_h-bss(a5),d4
  1006.  
  1007.         move.w    d0,d7
  1008.         mulu    #24,d7
  1009.         move.w    10(a0,d7.l),d5
  1010.         and.w    #$fffe,d5
  1011.  
  1012.         cmp.w    #2,got_file-bss(a5)
  1013.         bne.s    not_mark_vga
  1014.         or.w    #1,d5
  1015. not_mark_vga:
  1016.         bsr    objc_change
  1017.  
  1018.         move.w    #want_rgb_file,d0
  1019.  
  1020.         move.l    editfile*4(a3),a0
  1021.  
  1022.         move.w    work_x-bss(a5),d1
  1023.         move.w    work_y-bss(a5),d2
  1024.         move.w    work_w-bss(a5),d3
  1025.         move.w    work_h-bss(a5),d4
  1026.  
  1027.         move.w    d0,d7
  1028.         mulu    #24,d7
  1029.         move.w    10(a0,d7.l),d5
  1030.         and.w    #$fffe,d5
  1031.  
  1032.         cmp.w    #1,want_file-bss(a5)
  1033.         bne.s    not_mark_rgb_w
  1034.         or.w    #1,d5
  1035. not_mark_rgb_w:
  1036.         bsr    objc_change
  1037.  
  1038.         move.w    #want_tv_file,d0
  1039.  
  1040.         move.l    editfile*4(a3),a0
  1041.  
  1042.         move.w    work_x-bss(a5),d1
  1043.         move.w    work_y-bss(a5),d2
  1044.         move.w    work_w-bss(a5),d3
  1045.         move.w    work_h-bss(a5),d4
  1046.  
  1047.         move.w    d0,d7
  1048.         mulu    #24,d7
  1049.         move.w    10(a0,d7.w),d5
  1050.         and.w    #$fffe,d5
  1051.  
  1052.         tst.w    want_file-bss(a5)
  1053.         bne.s    not_mark_tv_w
  1054.         or.w    #1,d5
  1055. not_mark_tv_w:
  1056.         bsr    objc_change
  1057.  
  1058.         bra    window_handling_loop
  1059.  
  1060.  
  1061. appl_init:    move.w    #10,aes_opcode-bss(a5)
  1062.         clr.w    aes_sintin-bss(a5)
  1063.         move.w    #1,aes_sintout-bss(a5)
  1064.         clr.w    aes_saddrin-bss(a5)
  1065.         clr.w    aes_saddrout-bss(a5)
  1066.  
  1067.         bsr    call_aes
  1068.         rts
  1069.  
  1070. appl_exit:    move.w    #19,aes_opcode-bss(a5)
  1071.         clr.w    aes_sintin-bss(a5)
  1072.         clr.w    aes_sintout-bss(a5)
  1073.         clr.w    aes_saddrin-bss(a5)
  1074.         clr.w    aes_saddrout-bss(a5)
  1075.  
  1076.         bsr    call_aes
  1077.         rts
  1078.  
  1079. appl_write:    move.w    #12,aes_opcode-bss(a5)
  1080.         move.w    #2,aes_sintin-bss(a5)
  1081.         move.w    #1,aes_sintout-bss(a5)
  1082.         move.w    #1,aes_saddrin-bss(a5)
  1083.         clr.w    aes_saddrout-bss(a5)
  1084.  
  1085.         move.w    d0,intin-bss(a5)        *application id
  1086.         move.w    d1,intin+2-bss(a5)        *length of msg
  1087.  
  1088.         move.l    a0,addrin-bss(a5)
  1089.  
  1090.         bsr    call_aes
  1091.         rts
  1092.  
  1093. appl_read:    move.w    #11,aes_opcode-bss(a5)
  1094.         move.w    #2,aes_sintin-bss(a5)
  1095.         move.w    #1,aes_sintout-bss(a5)
  1096.         move.w    #1,aes_saddrin-bss(a5)
  1097.         clr.w    aes_saddrout-bss(a5)
  1098.  
  1099.         move.w    d0,intin-bss(a5)
  1100.         move.w    d1,intin+2-bss(a5)
  1101.  
  1102.         move.l    a0,addrin-bss(a5)
  1103.  
  1104.         bsr    call_aes
  1105.         rts
  1106.  
  1107. shel_read:    move.w    #120,aes_opcode-bss(a5)
  1108.         clr.w    aes_sintin-bss(a5)
  1109.         move.w    #1,aes_sintout-bss(a5)
  1110.         move.w    #2,aes_saddrin-bss(a5)
  1111.         clr.w    aes_saddrout-bss(a5)
  1112.  
  1113.         move.l    a0,addrin-bss(a5)
  1114.         move.l    a1,addrin+4-bss(a5)
  1115.  
  1116.         bsr    call_aes
  1117.         rts
  1118.  
  1119. graf_handle:    move.w    #77,aes_opcode-bss(a5)
  1120.         clr.w    aes_sintin-bss(a5)
  1121.         move.w    #5,aes_sintout-bss(a5)
  1122.         clr.w    aes_saddrin-bss(a5)
  1123.         clr.w    aes_saddrout-bss(a5)
  1124.  
  1125.         bsr    call_aes
  1126.         rts
  1127.  
  1128. open_virtual:    move.w    #100,vdi_opcode-bss(a5)
  1129.         clr.w    vdi_sptsin-bss(a5)
  1130.         clr.w    vdi_sintout-bss(a5)    *45 auto
  1131.         clr.w    vdi_sptsout-bss(a5)    *6 auto
  1132.         move.w    #11,vdi_sintin-bss(a5)
  1133.         move.w    graf_h-bss(a5),vdi_device-bss(a5)
  1134.  
  1135.         move.w    #1,intin-bss(a5)    *0
  1136.         move.w    #1,intin+2-bss(a5)    *1
  1137.         move.w    #1,intin+4-bss(a5)    *2
  1138.         move.w    #1,intin+6-bss(a5)    *3
  1139.         move.w    #1,intin+8-bss(a5)    *4
  1140.         move.w    #1,intin+10-bss(a5)     *5
  1141.         move.w    #1,intin+12-bss(a5)     *6
  1142.         move.w    #1,intin+14-bss(a5)     *7
  1143.         move.w    #1,intin+16-bss(a5)     *8
  1144.         move.w    #1,intin+18-bss(a5)     *9
  1145.         move.w    d0,intin+20-bss(a5)     *10
  1146.  
  1147.         bsr    call_vdi
  1148.  
  1149.         lea    workout-bss(a5),a1
  1150.         lea    intout-bss(a5),a0
  1151.  
  1152.         moveq    #44,d0
  1153.  
  1154. save_workout:    move.w    (a0)+,(a1)+
  1155.         dbra    d0,save_workout
  1156.  
  1157.         lea    ptsout-bss(a5),a0
  1158.         moveq    #11,d0
  1159.  
  1160. save_workout2:    move.w    (a0)+,(a1)+
  1161.         dbra    d0,save_workout2
  1162.         rts
  1163.  
  1164. bar:        move.w    #11,vdi_opcode-bss(a5)
  1165.         move.w    #2,vdi_sptsin-bss(a5)
  1166.         clr.w    vdi_sintout-bss(a5)
  1167.         clr.w    vdi_sptsout-bss(a5)
  1168.         clr.w    vdi_sintin-bss(a5)
  1169.         move.w    #1,vdi_subfunct-bss(a5)
  1170.         move.w    graf_h-bss(a5),vdi_device-bss(a5)
  1171.  
  1172.         move.w    d0,ptsin-bss(a5)        *x
  1173.         move.w    d1,ptsin+2-bss(a5)    *y
  1174.  
  1175.         move.w    d2,ptsin+4-bss(a5)    *x2
  1176.         move.w    d3,ptsin+6-bss(a5)    *y2
  1177.  
  1178.         bsr    call_vdi
  1179.         rts
  1180.  
  1181. set_fill_pattern:
  1182.         move.w    #24,vdi_opcode-bss(a5)
  1183.         clr.w    vdi_sptsin-bss(a5)
  1184.         move.w    #1,vdi_sintout-bss(a5)
  1185.         clr.w    vdi_sptsout-bss(a5)
  1186.         move.w    #1,vdi_sintin-bss(a5)
  1187.         move.w    #1,vdi_subfunct-bss(a5)
  1188.         move.w    graf_h-bss(a5),vdi_device-bss(a5)
  1189.  
  1190.         move.w    d0,intin-bss(a5)    *fill pattern
  1191.  
  1192.         bsr    call_vdi
  1193.         rts
  1194.  
  1195. set_fill_style:    move.w    #23,vdi_opcode-bss(a5)
  1196.         clr.w    vdi_sptsin-bss(a5)
  1197.         move.w    #1,vdi_sintout-bss(a5)
  1198.         clr.w    vdi_sptsout-bss(a5)
  1199.         move.w    #1,vdi_sintin-bss(a5)
  1200.         move.w    #1,vdi_subfunct-bss(a5)
  1201.         move.w    graf_h-bss(a5),vdi_device-bss(a5)
  1202.  
  1203.         move.w    d0,intin-bss(a5)    *fill style
  1204.  
  1205.         bsr    call_vdi
  1206.         rts
  1207.  
  1208. set_fill_color:    move.w    #25,vdi_opcode-bss(a5)
  1209.         clr.w    vdi_sptsin-bss(a5)
  1210.         move.w    #1,vdi_sintout-bss(a5)
  1211.         clr.w    vdi_sptsout-bss(a5)
  1212.         move.w    #1,vdi_sintin-bss(a5)
  1213.         move.w    #1,vdi_subfunct-bss(a5)
  1214.         move.w    graf_h-bss(a5),vdi_device-bss(a5)
  1215.  
  1216.         move.w    d0,intin-bss(a5)    *fill color
  1217.  
  1218.         bsr    call_vdi
  1219.         rts
  1220.  
  1221. set_fill_perimeter:
  1222.         move.w    #104,vdi_opcode-bss(a5)
  1223.         clr.w    vdi_sptsin-bss(a5)
  1224.         move.w    #1,vdi_sintout-bss(a5)
  1225.         clr.w    vdi_sptsout-bss(a5)
  1226.         move.w    #1,vdi_sintin-bss(a5)
  1227.         move.w    #1,vdi_subfunct-bss(a5)
  1228.         move.w    graf_h-bss(a5),vdi_device-bss(a5)
  1229.  
  1230.         move.w    d0,intin-bss(a5)    *fill color
  1231.  
  1232.         bsr    call_vdi
  1233.         rts
  1234.  
  1235. close_virtual:    move.w    #101,vdi_opcode-bss(a5)
  1236.         clr.w    vdi_sptsin-bss(a5)
  1237.         clr.w    vdi_sintout-bss(a5)
  1238.         clr.w    vdi_sptsout-bss(a5)
  1239.         clr.w    vdi_sintin-bss(a5)
  1240.         move.w    graf_h-bss(a5),vdi_device-bss(a5)
  1241.  
  1242.         bsr    call_vdi
  1243.  
  1244.         rts
  1245.  
  1246. wind_get:    move.w    #104,aes_opcode-bss(a5)
  1247.         move.w    #2,aes_sintin-bss(a5)
  1248.         move.w    #5,aes_sintout-bss(a5)
  1249.         clr.w    aes_saddrin-bss(a5)
  1250.         clr.w    aes_saddrout-bss(a5)
  1251.  
  1252.         move.w    d0,intin-bss(a5)
  1253.         move.w    d1,intin+2-bss(a5)
  1254.  
  1255.         bsr    call_aes
  1256.         rts
  1257.  
  1258. wind_update:    move.w    #107,aes_opcode-bss(a5)
  1259.         move.w    #1,aes_sintin-bss(a5)
  1260.         move.w    #1,aes_sintout-bss(a5)
  1261.         clr.w    aes_saddrin-bss(a5)
  1262.         clr.w    aes_saddrout-bss(a5)
  1263.  
  1264.         move.w    d0,intin-bss(a5)
  1265.  
  1266.         bsr    call_aes
  1267.         rts
  1268.  
  1269. wind_calc:    move.w    #108,aes_opcode-bss(a5)
  1270.         move.w    #6,aes_sintin-bss(a5)
  1271.         move.w    #5,aes_sintout-bss(a5)
  1272.         clr.w    aes_saddrin-bss(a5)
  1273.         clr.w    aes_saddrout-bss(a5)
  1274.  
  1275.         move.w    d4,intin-bss(a5)
  1276.         move.w    d5,intin+2-bss(a5)
  1277.         move.w    d0,intin+4-bss(a5)
  1278.         move.w    d1,intin+6-bss(a5)
  1279.         move.w    d2,intin+8-bss(a5)
  1280.         move.w    d3,intin+10-bss(a5)
  1281.  
  1282.         bsr    call_aes
  1283.         rts
  1284.  
  1285. objc_draw:    move.w    #42,aes_opcode-bss(a5)
  1286.         move.w    #6,aes_sintin-bss(a5)
  1287.         move.w    #1,aes_sintout-bss(a5)
  1288.         move.w    #1,aes_saddrin-bss(a5)
  1289.         clr.w    aes_saddrout-bss(a5)
  1290.  
  1291.         move.w    d0,intin-bss(a5)        *object to begin with
  1292.         move.w    d1,intin+2-bss(a5)        *depth
  1293.  
  1294.         move.w    d2,intin+4-bss(a5)        *the clipping area x,
  1295.         move.w    d3,intin+6-bss(a5)        *y
  1296.  
  1297.         move.w    d4,intin+8-bss(a5)        *w
  1298.         move.w    d5,intin+10-bss(a5)        *h
  1299.  
  1300.         move.l    a0,addrin-bss(a5)        *tree address
  1301.  
  1302.         bsr    call_aes
  1303.         rts
  1304.  
  1305. objc_find:    move.w    #43,aes_opcode-bss(a5)
  1306.         move.w    #4,aes_sintin-bss(a5)
  1307.         move.w    #1,aes_sintout-bss(a5)
  1308.         move.w    #1,aes_saddrin-bss(a5)
  1309.         clr.w    aes_saddrout-bss(a5)
  1310.  
  1311.         move.w    d0,intin-bss(a5)        *object to begin with
  1312.         move.w    d1,intin+2-bss(a5)        *depth
  1313.  
  1314.         move.w    d2,intin+4-bss(a5)        *mouse x
  1315.         move.w    d3,intin+6-bss(a5)        *y
  1316.  
  1317.         move.l    a0,addrin-bss(a5)        *tree address
  1318.  
  1319.         bsr    call_aes
  1320.         rts
  1321.  
  1322. objc_offset:    move.w    #44,aes_opcode-bss(a5)
  1323.         move.w    #1,aes_sintin-bss(a5)
  1324.         move.w    #3,aes_sintout-bss(a5)
  1325.         move.w    #1,aes_saddrin-bss(a5)
  1326.         clr.w    aes_saddrout-bss(a5)
  1327.  
  1328.         move.w    d0,intin-bss(a5)        *object #
  1329.  
  1330.         move.l    a0,addrin-bss(a5)        *tree address
  1331.  
  1332.         bsr    call_aes
  1333.         rts
  1334.  
  1335. objc_change:    move.w    #47,aes_opcode-bss(a5)
  1336.         move.w    #8,aes_sintin-bss(a5)
  1337.         move.w    #1,aes_sintout-bss(a5)
  1338.         move.w    #1,aes_saddrin-bss(a5)
  1339.         clr.w    aes_saddrout-bss(a5)
  1340.  
  1341.         move.w    d0,intin-bss(a5)        *object to begin with
  1342.         clr.w    intin+2-bss(a5)
  1343.         move.w    d1,intin+4-bss(a5)        *clipping,x
  1344.         move.w    d2,intin+6-bss(a5)        *y
  1345.         move.w    d3,intin+8-bss(a5)        *w
  1346.         move.w    d4,intin+10-bss(a5)        *h
  1347.  
  1348.         move.w    d5,intin+12-bss(a5)        *new status word
  1349.         move.w    d6,intin+14-bss(a5)        *redraw flag
  1350.  
  1351.         move.l    a0,addrin-bss(a5)        *tree address
  1352.  
  1353.         bsr    call_aes
  1354.         rts
  1355.  
  1356. fsel_input:    move.w    #90,aes_opcode-bss(a5)
  1357.         move.w    #0,aes_sintin-bss(a5)
  1358.         move.w    #2,aes_sintout-bss(a5)
  1359.         move.w    #4,aes_saddrin-bss(a5)
  1360.         clr.w    aes_saddrout-bss(a5)
  1361.  
  1362.         move.l    a0,addrin-bss(a5)        *path
  1363.         move.l    a1,addrin+4-bss(a5)        *name
  1364.         move.l    a2,addrin+8-bss(a5)        *top msg(not std)
  1365.         move.l    a3,addrin+12-bss(a5)        *bottom msg(not std)
  1366.  
  1367.         bsr    call_aes
  1368.         rts
  1369.  
  1370. graf_mouse:    move.w    #78,aes_opcode-bss(a5)
  1371.         move.w    #1,aes_sintin-bss(a5)
  1372.         move.w    #1,aes_sintout-bss(a5)
  1373.         move.w    #1,aes_saddrin-bss(a5)
  1374.         clr.w    aes_saddrout-bss(a5)
  1375.  
  1376.         move.w    d0,intin-bss(a5)
  1377.         move.l    a0,addrin-bss(a5)        *if d0=255, address
  1378.                             *shape ...
  1379.         bsr    call_aes
  1380.         rts
  1381.  
  1382. graf_growbox:    move.w    #73,aes_opcode-bss(a5)
  1383.         move.w    #8,aes_sintin-bss(a5)
  1384.         move.w    #1,aes_sintout-bss(a5)
  1385.         clr.w    aes_saddrin-bss(a5)
  1386.         clr.w    aes_saddrout-bss(a5)
  1387.  
  1388.         move.w    d0,intin-bss(a5)        *start x
  1389.         move.w    d1,intin+2-bss(a5)        *start y
  1390.         move.w    d2,intin+4-bss(a5)        *start w
  1391.         move.w    d3,intin+6-bss(a5)        *start h
  1392.  
  1393.         move.w    d4,intin+8-bss(a5)        *end x
  1394.         move.w    d5,intin+10-bss(a5)        *end y
  1395.         move.w    d6,intin+12-bss(a5)        *end w
  1396.         move.w    d7,intin+14-bss(a5)        *end h
  1397.  
  1398.         bsr    call_aes
  1399.         rts
  1400.  
  1401. graf_shrinkbox:    move.w    #74,aes_opcode-bss(a5)
  1402.         move.w    #8,aes_sintin-bss(a5)
  1403.         move.w    #1,aes_sintout-bss(a5)
  1404.         clr.w    aes_saddrin-bss(a5)
  1405.         clr.w    aes_saddrout-bss(a5)
  1406.  
  1407.         move.w    d0,intin-bss(a5)        *start x
  1408.         move.w    d1,intin+2-bss(a5)        *start y
  1409.         move.w    d2,intin+4-bss(a5)        *start w
  1410.         move.w    d3,intin+6-bss(a5)        *start h
  1411.  
  1412.         move.w    d4,intin+8-bss(a5)        *end x
  1413.         move.w    d5,intin+10-bss(a5)        *end y
  1414.         move.w    d6,intin+12-bss(a5)        *end w
  1415.         move.w    d7,intin+14-bss(a5)        *end h
  1416.  
  1417.         bsr    call_aes
  1418.         rts
  1419.  
  1420. menu_bar:    move.w    #30,aes_opcode-bss(a5)
  1421.         move.w    #1,aes_sintin-bss(a5)
  1422.         move.w    #1,aes_sintout-bss(a5)
  1423.         move.w    #1,aes_saddrin-bss(a5)
  1424.         clr.w    aes_saddrout-bss(a5)
  1425.  
  1426.         move.w    d0,intin-bss(a5)        *show flag, 1=s,0=e
  1427.  
  1428.         move.l    a0,addrin-bss(a5)        *tree address
  1429.  
  1430.         bsr    call_aes
  1431.         rts
  1432.  
  1433. menu_register:    move.w    #35,aes_opcode-bss(a5)
  1434.         move.w    #1,aes_sintin-bss(a5)
  1435.         move.w    #1,aes_sintout-bss(a5)
  1436.         move.w    #1,aes_saddrin-bss(a5)
  1437.         clr.w    aes_saddrout-bss(a5)
  1438.  
  1439.         move.w    d0,intin-bss(a5)        *object #
  1440.  
  1441.         move.l    a0,addrin-bss(a5)        *tree address
  1442.  
  1443.         bsr    call_aes
  1444.         rts
  1445.  
  1446. menu_icheck:    move.w    #31,aes_opcode-bss(a5)
  1447.         move.w    #2,aes_sintin-bss(a5)
  1448.         move.w    #1,aes_sintout-bss(a5)
  1449.         move.w    #1,aes_saddrin-bss(a5)
  1450.         clr.w    aes_saddrout-bss(a5)
  1451.  
  1452.         move.w    d0,intin-bss(a5)        *object #
  1453.         move.w    d1,intin+2-bss(a5)        *show flag, 1=s,0=e
  1454.  
  1455.         move.l    a0,addrin-bss(a5)        *tree address
  1456.  
  1457.         bsr    call_aes
  1458.         rts
  1459.  
  1460. menu_enable:    move.w    #32,aes_opcode-bss(a5)
  1461.         move.w    #2,aes_sintin-bss(a5)
  1462.         move.w    #1,aes_sintout-bss(a5)
  1463.         move.w    #1,aes_saddrin-bss(a5)
  1464.         clr.w    aes_saddrout-bss(a5)
  1465.  
  1466.         move.w    d0,intin-bss(a5)        *object #
  1467.         move.w    d1,intin+2-bss(a5)        *act f, 1=a,0=d
  1468.  
  1469.         move.l    a0,addrin-bss(a5)        *tree address
  1470.  
  1471.         bsr    call_aes
  1472.         rts
  1473.  
  1474. menu_tnormal:    move.w    #33,aes_opcode-bss(a5)
  1475.         move.w    #2,aes_sintin-bss(a5)
  1476.         move.w    #1,aes_sintout-bss(a5)
  1477.         move.w    #1,aes_saddrin-bss(a5)
  1478.         clr.w    aes_saddrout-bss(a5)
  1479.  
  1480.         move.w    d0,intin-bss(a5)        *object # (title #)
  1481.         move.w    d1,intin+2-bss(a5)        *rev. flag, 1=n,0=r
  1482.  
  1483.         move.l    a0,addrin-bss(a5)        *tree address
  1484.  
  1485.         bsr    call_aes
  1486.         rts
  1487.  
  1488. init_em_parameters:
  1489.         move.w    #25,aes_opcode-bss(a5)
  1490.         move.w    #16,aes_sintin-bss(a5)
  1491.         move.w    #7,aes_sintout-bss(a5)
  1492.         move.w    #1,aes_saddrin-bss(a5)
  1493.         clr.w    aes_saddrout-bss(a5)
  1494.  
  1495.         clr.w    intin-bss(a5)
  1496.         clr.l    addrin-bss(a5)
  1497.         rts
  1498.  
  1499. setup_em_keyboard:
  1500.         or.w    #1,intin-bss(a5)
  1501.         rts
  1502.  
  1503. setup_em_mouse1:
  1504.         or.w    #4,intin-bss(a5)
  1505.  
  1506.         move.w    d0,intin+8-bss(a5)    *moflags, 0=end upon entry
  1507.                         *1=end upon exit
  1508.         move.w    d1,intin+10-bss(a5)    *x
  1509.         move.w    d2,intin+12-bss(a5)    *y
  1510.         move.w    d3,intin+14-bss(a5)    *w
  1511.         move.w    d4,intin+16-bss(a5)    *h
  1512.         rts
  1513.  
  1514. setup_em_mouse2:
  1515.         or.w    #8,intin-bss(a5)
  1516.  
  1517.         move.w    d0,intin+18-bss(a5)    *moflags, 0=end upon entry
  1518.                         *1=end upon exit
  1519.         move.w    d1,intin+20-bss(a5)    *x
  1520.         move.w    d2,intin+22-bss(a5)    *y
  1521.         move.w    d3,intin+24-bss(a5)    *w
  1522.         move.w    d4,intin+26-bss(a5)    *h
  1523.         rts
  1524.  
  1525. setup_em_mesag:
  1526.         or.w    #16,intin-bss(a5)
  1527.  
  1528.         move.l    a0,addrin-bss(a5)    *address to message buffer
  1529.  
  1530.         move.l    a0,d0
  1531.  
  1532.         moveq    #0,d1
  1533.  
  1534.         move.l    d1,(a0)+
  1535.         move.l    d1,(a0)+
  1536.         move.l    d1,(a0)+
  1537.         move.l    d1,(a0)+
  1538.  
  1539.         move.l    d0,a0
  1540.         rts
  1541.  
  1542. setup_em_button:
  1543.         or.w    #2,intin-bss(a5)
  1544.  
  1545.         move.w    d0,intin+2-bss(a5)    *number of clicks
  1546.         move.w    d1,intin+4-bss(a5)    *mask
  1547.         move.w    d2,intin+6-bss(a5)    *status
  1548.         rts
  1549.  
  1550. setup_em_timer:
  1551.         or.w    #32,intin-bss(a5)
  1552.  
  1553.         move.w    d0,intin+28-bss(a5)    *timer, low word
  1554.         swap    d0
  1555.         move.w    d0,intin+30-bss(a5)    *high word
  1556.         rts
  1557.  
  1558. do_evnt_multi:
  1559.         bsr    call_aes
  1560.         rts
  1561.  
  1562. wind_create:    move.w    #100,aes_opcode-bss(a5)
  1563.         move.w    #5,aes_sintin-bss(a5)
  1564.         move.w    #1,aes_sintout-bss(a5)
  1565.         clr.w    aes_saddrin-bss(a5)
  1566.         clr.w    aes_saddrout-bss(a5)
  1567.  
  1568.         move.w    d4,intin-bss(a5)
  1569.         move.w    d0,intin+4-bss(a5)
  1570.         move.w    d1,intin+6-bss(a5)
  1571.         move.w    d2,intin+8-bss(a5)
  1572.         move.w    d3,intin+10-bss(a5)
  1573.  
  1574.         bsr    call_aes
  1575.         rts
  1576.  
  1577. wind_delete:    move.w    #103,aes_opcode-bss(a5)
  1578.         move.w    #1,aes_sintin-bss(a5)
  1579.         move.w    #1,aes_sintout-bss(a5)
  1580.         clr.w    aes_saddrin-bss(a5)
  1581.         clr.w    aes_saddrout-bss(a5)
  1582.  
  1583.         move.w    d0,intin-bss(a5)
  1584.  
  1585.         bsr    call_aes
  1586.         rts
  1587.  
  1588. wind_open:    move.w    #101,aes_opcode-bss(a5)
  1589.         move.w    #5,aes_sintin-bss(a5)
  1590.         move.w    #1,aes_sintout-bss(a5)
  1591.         clr.w    aes_saddrin-bss(a5)
  1592.         clr.w    aes_saddrout-bss(a5)
  1593.  
  1594.         move.w    d4,intin-bss(a5)
  1595.  
  1596.         move.w    d0,intin+2-bss(a5)
  1597.         move.w    d1,intin+4-bss(a5)
  1598.         move.w    d2,intin+6-bss(a5)
  1599.         move.w    d3,intin+8-bss(a5)
  1600.  
  1601.         bsr    call_aes
  1602.         rts
  1603.  
  1604. wind_close:    move.w    #102,aes_opcode-bss(a5)
  1605.         move.w    #1,aes_sintin-bss(a5)
  1606.         move.w    #1,aes_sintout-bss(a5)
  1607.         clr.w    aes_saddrin-bss(a5)
  1608.         clr.w    aes_saddrout-bss(a5)
  1609.  
  1610.         move.w    d0,intin-bss(a5)
  1611.  
  1612.         bsr    call_aes
  1613.         rts
  1614.  
  1615. wind_set:    move.w    #105,aes_opcode-bss(a5)
  1616.         move.w    #6,aes_sintin-bss(a5)
  1617.         move.w    #1,aes_sintout-bss(a5)
  1618.         clr.w    aes_saddrin-bss(a5)
  1619.         clr.w    aes_saddrout-bss(a5)
  1620.  
  1621.         move.w    d0,intin-bss(a5)
  1622.         move.w    d1,intin+2-bss(a5)
  1623.  
  1624.         move.w    d2,intin+4-bss(a5)
  1625.         move.w    d3,intin+6-bss(a5)
  1626.         move.w    d4,intin+8-bss(a5)
  1627.         move.w    d5,intin+10-bss(a5)
  1628.  
  1629.         bsr    call_aes
  1630.         rts
  1631.  
  1632. init_aes_sys:    lea    aes_pb-bss(a5),a3
  1633.  
  1634.         lea    aes_control-bss(a5),a2
  1635.         move.l    a2,(a3)+
  1636.         lea    aes_global-bss(a5),a2
  1637.         move.l    a2,(a3)+
  1638.         lea    intin-bss(a5),a2
  1639.         move.l    a2,(a3)+
  1640.         lea    intout-bss(a5),a2
  1641.         move.l    a2,(a3)+
  1642.         lea    addrin-bss(a5),a2
  1643.         move.l    a2,(a3)+
  1644.         lea    addrout-bss(a5),a2
  1645.         move.l    a2,(a3)+
  1646.         rts
  1647.  
  1648. init_vdi_sys:    lea    vdi_pb-bss(a5),a3
  1649.  
  1650.         lea    vdi_control-bss(a5),a2
  1651.         move.l    a2,(a3)+
  1652.         lea    intin-bss(a5),a2
  1653.         move.l    a2,(a3)+
  1654.         lea    ptsin-bss(a5),a2
  1655.         move.l    a2,(a3)+
  1656.         lea    intout-bss(a5),a2
  1657.         move.l    a2,(a3)+
  1658.         lea    ptsout-bss(a5),a2
  1659.         move.l    a2,(a3)+
  1660.         rts
  1661.  
  1662. call_aes:    lea    aes_pb-bss(a5),a0
  1663.  
  1664.         move.l    a0,d1
  1665.         move.l    #$c8,d0
  1666.         trap    #2
  1667.  
  1668.         move.w    intout-bss(a5),d0
  1669.         rts
  1670.  
  1671. call_vdi:    lea    vdi_pb-bss(a5),a0
  1672.  
  1673.         move.l    a0,d1
  1674.         moveq    #$73,d0
  1675.         trap    #2
  1676.  
  1677.         move.w    intout-bss(a5),d0
  1678.         rts
  1679.  
  1680. ob_flags:    mulu    #24,d0
  1681.         move.w    8(a0,d0.l),d0
  1682.         rts
  1683.  
  1684. ob_state:    mulu    #24,d0
  1685.         move.w    10(a0,d0.l),d0
  1686.         rts
  1687.  
  1688. set_ob_flags:    mulu    #24,d0
  1689.         move.w    d1,8(a0,d0.l)
  1690.         rts
  1691.  
  1692. set_ob_state:    mulu    #24,d0
  1693.         move.w    d1,10(a0,d0.l)
  1694.         rts
  1695.  
  1696.  
  1697. init_once:    bsr    init_aes_sys
  1698.         bsr    init_vdi_sys
  1699.  
  1700.         bsr    appl_init
  1701.  
  1702.         move.w    d0,appl_id-bss(a5)
  1703.         bmi    quit_right_now
  1704.  
  1705.         move.w    aes_version-bss(a5),d0
  1706.         beq    auto_load
  1707.  
  1708.         lea    $80(a6),a1        *command line address
  1709.         lea    path-bss(a5),a0        *path and name of me
  1710.  
  1711.         bsr    shel_read
  1712.  
  1713.         lea    path-bss(a5),a0        *get path address
  1714.  
  1715. find_end_of_prg_path:
  1716.         tst.b    (a0)+
  1717.         bne    find_end_of_prg_path
  1718.  
  1719.         lea    -5(a0),a0        *compensate for .??? + NULL
  1720.  
  1721.         move.b    (a0)+,d0
  1722.         ror.l    #8,d0 
  1723.  
  1724.         move.b    (a0)+,d0
  1725.         ror.l    #8,d0 
  1726.  
  1727.         move.b    (a0)+,d0
  1728.         ror.l    #8,d0 
  1729.  
  1730.         move.b    (a0)+,d0
  1731.         ror.l    #8,d0 
  1732.  
  1733.         cmp.l    #"CCA.",d0
  1734.         bne.s    not_acc_loaded
  1735.  
  1736.         st    acc_load-bss(a5)
  1737. not_acc_loaded:
  1738.         clr.w    loaded_rezf-bss(a5)    *rezfool NOT loaded
  1739.         bsr    get_cookie
  1740.  
  1741.         move.l    text_adr-bss(a5),d0    *rezfool resident ???
  1742.         beq.s    no_search_command
  1743.  
  1744.         move.w    #1,loaded_rezf-bss(a5)    *mark that it was resident
  1745.  
  1746.         tst.b    $80(a6)            *any command line
  1747.         bne    auto_load
  1748.  
  1749.         bsr    check_for_rezfool    *is there a 'REZFOOL='
  1750.  
  1751.         tst.l    enviro_adr-bss(a5)    *if so, skip this shit
  1752.         bne    auto_load
  1753.  
  1754. no_search_command:
  1755.         bsr    graf_handle
  1756.  
  1757.         move.w    d0,graf_h-bss(a5)
  1758.  
  1759.         move.w    intout+2-bss(a5),char_width-bss(a5)
  1760.         move.w    intout+4-bss(a5),char_heigth-bss(a5)
  1761.  
  1762.         move.w    #"er",desk_id-bss(a5)
  1763.  
  1764.         moveq    #2,d0            *Real Cordinates
  1765.         bsr    open_virtual
  1766.  
  1767.         bsr    obfix_resource
  1768.  
  1769.         move.l    #editfile*4,rcs_screen-bss(a5)
  1770.         move.l    #-1,info_temp-bss(a5)
  1771.  
  1772.         tst.l    text_adr-bss(a5)
  1773.         bne.s    allow_memory_edit
  1774.  
  1775.         move.l    tree_pointer-bss(a5),a0
  1776.         move.l    editfile*4(a0),a0
  1777.  
  1778.         lea    edit_mem*24(a0),a0
  1779.  
  1780.         move.l    8(a0),d0
  1781.         move.l    d0,org_status_emb-bss(a5)
  1782.         and.l    #$fffefffe,d0
  1783.         or.l    #8,d0
  1784.         move.l    d0,8(a0)        
  1785.  
  1786.         move.l    tree_pointer-bss(a5),a0
  1787.         move.l    menu*4(a0),a0
  1788.  
  1789.         move.w    #edit_mem_menu,d0
  1790.         moveq    #0,d1
  1791.  
  1792.         bsr    menu_enable
  1793.  
  1794.         move.l    tree_pointer-bss(a5),a0
  1795.         move.l    menu*4(a0),a0
  1796.  
  1797.         move.w    #reset_menu,d0
  1798.         moveq    #0,d1
  1799.  
  1800.         bsr    menu_enable
  1801. allow_memory_edit:
  1802.         moveq    #0,d4            *output total dimensions
  1803.         moveq    #%1011,d5
  1804.  
  1805.         move.l    tree_pointer-bss(a5),a0
  1806.  
  1807.         move.l    editfile*4(a0),a0    *get first tree information
  1808.  
  1809.         move.w    16(a0),d0
  1810.         move.w    18(a0),d1
  1811.         move.w    20(a0),d2
  1812.         move.w    22(a0),d3
  1813.  
  1814.         bsr    wind_calc
  1815.  
  1816.         move.w    intout+6-bss(a5),d6
  1817.         move.w    intout+8-bss(a5),d7
  1818.  
  1819.         moveq    #0,d0            *desktop
  1820.         moveq    #4,d1            *get size
  1821.  
  1822.         bsr    wind_get
  1823.  
  1824.         move.w    d6,d2            *width of working area
  1825.         move.w    d7,d3            *heigth of working area
  1826.         
  1827.         move.w    intout+6-bss(a5),d0    *width of desktop
  1828.         lsr.w    #1,d0            */2
  1829.  
  1830.         move.w    d2,d4            *width of window
  1831.         lsr.w    #1,d4            */2
  1832.  
  1833.         sub.w    d4,d0            *center
  1834.         add.w    intout+2-bss(a5),d0    *relocate (this should be 0)
  1835.  
  1836.         move.w    intout+8-bss(a5),d1    *heigth of desktop
  1837.         lsr.w    #1,d1            */2
  1838.  
  1839.         move.w    d3,d4            *heigth of window
  1840.         lsr.w    #1,d4            */2
  1841.  
  1842.         sub.w    d4,d1            *center
  1843.         add.w    intout+4-bss(a5),d1    *relocate (this should be 0)
  1844.         
  1845.         move.w    d0,window_x-bss(a5)
  1846.         move.w    d1,window_y-bss(a5)
  1847.         move.w    d2,window_w-bss(a5)
  1848.         move.w    d3,window_h-bss(a5)
  1849.         rts
  1850.  
  1851. position_trees:    move.l    tree_pointer-bss(a5),a0
  1852.         move.l    4*editfile(a0),a0
  1853.  
  1854.         move.w    work_x-bss(a5),16(a0)
  1855.         move.w    work_y-bss(a5),18(a0)
  1856.  
  1857.         move.l    tree_pointer-bss(a5),a0
  1858.         move.l    4*editmem(a0),a0
  1859.  
  1860.         move.w    work_x-bss(a5),16(a0)
  1861.         move.w    work_y-bss(a5),18(a0)
  1862.  
  1863.         move.l    tree_pointer-bss(a5),a0
  1864.         move.l    4*info_form(a0),a0
  1865.  
  1866.         move.w    work_x-bss(a5),16(a0)
  1867.         move.w    work_y-bss(a5),18(a0)
  1868.  
  1869.         tst.l    text_adr-bss(a5)
  1870.         bne    start_on_memory_screen
  1871.  
  1872.         rts
  1873.  
  1874. start_on_memory_screen:
  1875.         move.l    #editmem*4,rcs_screen-bss(a5)
  1876.         rts
  1877.  
  1878. popup_window:
  1879.  
  1880.  
  1881.         move.w    window_x-bss(a5),d0
  1882.         move.w    window_y-bss(a5),d1
  1883.         move.w    window_w-bss(a5),d2
  1884.         move.w    window_h-bss(a5),d3
  1885.  
  1886.         moveq    #%1011,d4
  1887.  
  1888.         bsr    wind_create
  1889.  
  1890.         move.w    d0,window_handle-bss(a5)
  1891.  
  1892.         lea    window_name-data(a4),a0
  1893.         move.l    a0,d2
  1894.         move.l    d2,d3
  1895.         swap    d2
  1896.  
  1897.         moveq    #2,d1
  1898.  
  1899.         bsr    wind_set
  1900.  
  1901.         moveq    #1,d0
  1902.         bsr    wind_update
  1903.  
  1904.         move.w    window_x-bss(a5),d0
  1905.         move.w    window_y-bss(a5),d1
  1906.         move.w    window_w-bss(a5),d2
  1907.         move.w    window_h-bss(a5),d3
  1908.  
  1909.         move.w    d0,d4
  1910.         move.w    d1,d5
  1911.         move.w    d2,d6
  1912.         move.w    d3,d7
  1913.  
  1914.         lsr.w    #1,d2
  1915.         lsr.w    #1,d3
  1916.  
  1917.         add.w    d2,d0
  1918.         add.w    d3,d1
  1919.  
  1920.         moveq    #1,d2
  1921.         moveq    #1,d3
  1922.  
  1923.         bsr    graf_growbox
  1924.  
  1925.         move.w    window_x-bss(a5),d0
  1926.         move.w    window_y-bss(a5),d1
  1927.         move.w    window_w-bss(a5),d2
  1928.         move.w    window_h-bss(a5),d3
  1929.         move.w    window_handle-bss(a5),d4
  1930.  
  1931.         bsr    wind_open
  1932.  
  1933.         moveq    #0,d0
  1934.         bsr    wind_update
  1935.  
  1936.         move.w    window_handle-bss(a5),d0
  1937.         moveq    #4,d1
  1938.  
  1939.         bsr    wind_get
  1940.  
  1941.         move.w    intout+2-bss(a5),work_x-bss(a5)
  1942.         move.w    intout+4-bss(a5),work_y-bss(a5)
  1943.         move.w    intout+6-bss(a5),work_w-bss(a5)
  1944.         move.w    intout+8-bss(a5),work_h-bss(a5)
  1945.  
  1946.         bsr    position_trees
  1947.         rts
  1948.  
  1949. close_window:    move.w    window_handle-bss(a5),d0
  1950.         bsr    wind_close
  1951.  
  1952.         move.w    window_x-bss(a5),d0
  1953.         move.w    window_y-bss(a5),d1
  1954.         move.w    window_w-bss(a5),d2
  1955.         move.w    window_h-bss(a5),d3
  1956.  
  1957.         move.w    d0,d4
  1958.         move.w    d1,d5
  1959.         move.w    d2,d6
  1960.         move.w    d3,d7
  1961.  
  1962.         lsr.w    #1,d6
  1963.         lsr.w    #1,d7
  1964.  
  1965.         add.w    d6,d4
  1966.         add.w    d7,d5
  1967.  
  1968.         moveq    #1,d6
  1969.         moveq    #1,d7
  1970.  
  1971.         bsr    graf_shrinkbox
  1972.         rts
  1973.  
  1974. delete_window:
  1975.         move.w    window_handle-bss(a5),d0
  1976.         bsr    wind_delete
  1977.         rts
  1978.  
  1979. update_screen:    moveq    #1,d0                *begupd
  1980.         bsr    wind_update
  1981.  
  1982.         move.w    window_handle-bss(a5),d0    *get workarea
  1983.         moveq    #4,d1                *coords
  1984.  
  1985.         bsr    wind_get
  1986.  
  1987.         move.w    intout+2-bss(a5),work_x-bss(a5)    *save, so we now it's
  1988.         move.w    intout+4-bss(a5),work_y-bss(a5)    *current position
  1989.         move.w    intout+6-bss(a5),work_w-bss(a5)
  1990.         move.w    intout+8-bss(a5),work_h-bss(a5)
  1991.  
  1992.         move.l    tree_pointer-bss(a5),a0        *
  1993.         add.l    rcs_screen-bss(a5),a0
  1994.         move.l    (a0),a0
  1995.  
  1996.         move.w    work_x-bss(a5),16(a0)    *update tree coordinates
  1997.         move.w    work_y-bss(a5),18(a0)
  1998.  
  1999.         move.w    window_handle-bss(a5),d0    *get updatearea
  2000.         moveq    #11,d1                *coords rect #1
  2001.  
  2002.         bsr    wind_get
  2003.  
  2004. update_by_rl_loop:        
  2005.         tst.l    intout+6-bss(a5)    *width&height=0? (then done)
  2006.         beq    no_more_updating
  2007.  
  2008.         move.l    tree_pointer-bss(a5),a0    *tree pointers
  2009.         add.l    rcs_screen-bss(a5),a0    *current tree
  2010.         move.l    (a0),a0            *get address
  2011.  
  2012.         moveq    #0,d0            *start drawing object null
  2013.         moveq    #7,d1            *7 sublevels
  2014.  
  2015.         move.w    intout+2-bss(a5),d2    *clipping, x
  2016.         move.w    intout+4-bss(a5),d3    *clipping, y
  2017.         move.w    intout+6-bss(a5),d4    *clipping, w
  2018.         move.w    intout+8-bss(a5),d5    *clipping, h
  2019.  
  2020.         bsr    objc_draw        *draw it
  2021.  
  2022.         move.w    window_handle-bss(a5),d0    *get updatearea
  2023.         moveq    #12,d1                *coords rect #n
  2024.  
  2025.         bsr    wind_get
  2026.         bra.s    update_by_rl_loop
  2027. no_more_updating:
  2028.         moveq    #0,d0            *endupd
  2029.         bsr    wind_update
  2030.  
  2031.         bra    window_handling_loop
  2032.  
  2033. top_my_window:    move.w    window_handle-bss(a5),d0
  2034.         moveq    #10,d1
  2035.  
  2036.         bsr    wind_set
  2037.  
  2038.         cmp.l    #4*editmem,rcs_screen-bss(a5)
  2039.         beq    update_mem_screen
  2040.  
  2041.         cmp.l    #4*editfile,rcs_screen-bss(a5)
  2042.         beq    update_file_screen
  2043.         bra    window_handling_loop
  2044.  
  2045. menu_options:    move.w    em_buffer+6-bss(a5),d0
  2046.         moveq    #1,d1
  2047.  
  2048.         move.l    tree_pointer-bss(a5),a0
  2049.         move.l    menu*4(a0),a0
  2050.  
  2051.         bsr    menu_tnormal
  2052.  
  2053.         move.w    em_buffer+8-bss(a5),d0
  2054.  
  2055.         cmp.w    #about,d0
  2056.         beq    show_info
  2057.  
  2058.         tst.l    text_adr-bss(a5)
  2059.         beq    dont_check_mem_mc
  2060.  
  2061.         cmp.l    #editmem*4,rcs_screen-bss(a5)
  2062.         beq.s    dont_check_mem_mc
  2063.  
  2064.         cmp.w    #edit_mem_menu,d0
  2065.         bne.s    dont_check_mem_mc
  2066.  
  2067.         move.l    #-1,info_temp-bss(a5)
  2068.         move.l    #editmem*4,rcs_screen-bss(a5)
  2069.         bra    exit_toggle
  2070.  
  2071. dont_check_mem_mc:
  2072.         cmp.l    #editfile*4,rcs_screen-bss(a5)
  2073.         beq.s    dont_check_file_mc
  2074.  
  2075.         cmp.w    #edit_file_menu,d0
  2076.         bne.s    dont_check_file_mc
  2077.  
  2078.         move.l    #-1,info_temp-bss(a5)
  2079.         move.l    #editfile*4,rcs_screen-bss(a5)
  2080.         bra    exit_toggle
  2081.  
  2082. dont_check_file_mc:
  2083.         cmp.w    #quit_menu,d0
  2084.         beq    close_window_and_exit
  2085.  
  2086.         cmp.w    #reset_menu,d0
  2087.         beq    reset_sets
  2088.  
  2089.         cmp.w    #write_menu,d0
  2090.         beq    write_to_file
  2091.  
  2092.         bra    window_handling_loop
  2093.  
  2094.  
  2095. write_to_file:    move.w    #$19,-(sp)        *get current drive
  2096.         trap    #1
  2097.         addq.l    #2,sp
  2098.  
  2099.         add.b    #"A",d0            *make it a letter
  2100.         move.b    d0,path-bss(a5)
  2101.  
  2102.         move.b    #":",path+1-bss(a5)
  2103.  
  2104.         clr.w    -(sp)
  2105.         pea    path+2-bss(a5)
  2106.         move.w    #$47,-(sp)
  2107.         trap    #1
  2108.         addq.l    #8,sp
  2109.  
  2110.         lea    path-bss(a5),a0
  2111.  
  2112. find_pathend:    tst.b    (a0)+
  2113.         bne.s    find_pathend
  2114.  
  2115.         subq.l    #1,a0
  2116.  
  2117.         move.b    #"\",(a0)+
  2118.  
  2119.         lea    filename-bss(a5),a1
  2120.  
  2121.         move.b    #"R",(a0)+
  2122.         move.b    #"E",(a0)+
  2123.         move.b    #"Z",(a0)+
  2124.         move.b    #"_",(a0)+
  2125.         move.b    #"F",(a0)+
  2126.         move.b    #".",(a0)+
  2127.         move.b    #"P",(a0)+
  2128.         move.b    #"R",(a0)+
  2129.         move.b    #"G",(a0)+
  2130.  
  2131.         move.b    #"R",(a1)+
  2132.         move.b    #"E",(a1)+
  2133.         move.b    #"Z",(a1)+
  2134.         move.b    #"_",(a1)+
  2135.         move.b    #"F",(a1)+
  2136.         move.b    #".",(a1)+
  2137.         move.b    #"P",(a1)+
  2138.         move.b    #"R",(a1)+
  2139.         move.b    #"G",(a1)+
  2140.  
  2141.         clr.b    (a0)+
  2142.  
  2143.         lea    path-bss(a5),a0
  2144.         lea    filename-bss(a5),a1
  2145.         lea    where_is-data(a4),a2
  2146.         lea    rez_fooler_t-data(a4),a3
  2147.  
  2148.         bsr    fsel_input
  2149.  
  2150.         move.w    intout+2-bss(a5),d0    *cancel selected ?
  2151.         beq    cancel_selected
  2152.  
  2153.         move.b    path-bss(a5),d0        *change    to    specified    drive
  2154.         sub.b    #"A",d0
  2155.         and.l    #$ff,d0
  2156.  
  2157.         move.w    d0,-(sp)
  2158.         move.w    #14,-(sp)
  2159.         trap    #1
  2160.         addq.l    #4,sp
  2161.  
  2162.         lea    path-bss(a5),a0
  2163.  
  2164. find_end_of_path:
  2165.         tst.b    (a0)+
  2166.         bne.s    find_end_of_path
  2167.  
  2168. find_path_end:    cmpi.b    #"\",-(a0)
  2169.         bne.s    find_path_end
  2170.  
  2171.         tst.b    (a0)+
  2172.  
  2173.         movea.l    a0,a6
  2174.         clr.b    (a0)+
  2175.  
  2176.         pea    path-bss(a5)        *set path
  2177.         move.w    #$3b,-(sp)
  2178.         trap    #1
  2179.         addq.l    #6,sp
  2180.  
  2181.         tst.w    d0            *can goto that path
  2182.         bmi    show_up_box
  2183.  
  2184.         lea    filename-bss(a5),a1
  2185.  
  2186.         moveq    #11,d7
  2187.  
  2188. copy_name:    move.b    (a1)+,(a6)+
  2189.         dbra    d7,copy_name
  2190.  
  2191.         pea    dta-bss(a5)
  2192.         move.w    #$1a,-(sp)
  2193.         trap    #1
  2194.         addq.l    #6,sp
  2195.  
  2196.         move.w    #0,-(sp)
  2197.         pea    path-bss(a5)
  2198.         move.w    #$4e,-(sp)
  2199.         trap    #1
  2200.         lea    8(sp),sp
  2201.  
  2202.         tst.w    d0            *file coulde be located
  2203.         bmi    write_to_file
  2204.  
  2205.         lea    decode_table-data(a4),a0
  2206.  
  2207.         move.w    got_file-bss(a5),d0
  2208.         asl.w    #1,d0
  2209.  
  2210.         move.w    0(a0,d0.w),decode_fw-bss(a5)        
  2211.  
  2212.         move.w    want_file-bss(a5),d0
  2213.         asl.w    #1,d0
  2214.         move.w    0(a0,d0.w),decode_fw+2-bss(a5)        
  2215.  
  2216.         move.w    #2,-(sp)        *r/w access
  2217.         pea    path-bss(a5)
  2218.         move.w    #$3d,-(sp)
  2219.         trap    #1
  2220.         addq.l    #8,sp
  2221.  
  2222.         tst.w    d0
  2223.         bmi    show_we_box
  2224.  
  2225.         move.w    d0,file_handle-bss(a5)
  2226.  
  2227.         clr.w    -(sp)
  2228.         move.w    file_handle-bss(a5),-(sp)
  2229.         pea    $1c.w
  2230.         move.w    #$42,-(sp)
  2231.         trap    #1
  2232.         lea    10(sp),sp
  2233.  
  2234.         tst.l    d0
  2235.         bmi    show_we_box
  2236.  
  2237.         pea    safety_check-bss(a5)
  2238.         pea    2.w
  2239.         move.w    file_handle-bss(a5),-(sp)
  2240.         move.w    #$3f,-(sp)
  2241.         trap    #1
  2242.         lea    12(sp),sp
  2243.  
  2244.         cmp.l    #2,d0
  2245.         bne    show_we_box
  2246.  
  2247.         move.w    safety_check-bss(a5),d0
  2248.         move.w    d0,d1
  2249.  
  2250.         and.w    #$ff00,d0        *only high byte
  2251.         cmp.w    #$6000,d0        *bra ???
  2252.         bne    not_rez_f        *no, faked
  2253.  
  2254.         cmp.w    d0,d1            *bra.s ?
  2255.         beq    not_rez_f        *no, faked
  2256.  
  2257.         pea    decode_fw-bss(a5)
  2258.         pea    4.w
  2259.         move.w    file_handle-bss(a5),-(sp)
  2260.         move.w    #$40,-(sp)
  2261.         trap    #1
  2262.         lea    12(sp),sp
  2263.  
  2264.         cmp.l    #4,d0
  2265.         bne    show_we_box
  2266.  
  2267.         move.w    file_handle-bss(a5),-(sp)
  2268.         move.w    #$3e,-(sp)
  2269.         trap    #1
  2270.         addq.l    #8,sp
  2271.  
  2272.         tst.w    d0
  2273.         bmi    show_we_box
  2274.  
  2275.         move.l    #good_write*4,d0
  2276.         bra.s    show_other_box
  2277.  
  2278. cancel_selected:
  2279.         bra    window_handling_loop
  2280.  
  2281. not_rez_f:    move.l    #faked*4,d0
  2282.         bra.s    show_other_box
  2283.  
  2284. show_we_box:    move.l    #write_e*4,d0
  2285.         bra.s    show_other_box
  2286.  
  2287. show_up_box:    move.l    #unknown_path*4,d0
  2288.  
  2289. show_other_box:    cmp.l    #editmem*4,rcs_screen-bss(a5)
  2290.         bne.s    not_save_on_em_screen
  2291.  
  2292.         move.l    #editmem*4,info_temp-bss(a5)
  2293. not_save_on_em_screen:
  2294.         cmp.l    #editfile*4,rcs_screen-bss(a5)
  2295.         bne.s    not_save_on_ef_screen
  2296.  
  2297.         move.l    #editfile*4,info_temp-bss(a5)
  2298. not_save_on_ef_screen:
  2299.  
  2300.         move.l    d0,rcs_screen-bss(a5)
  2301.  
  2302.         bsr    exit_toggle
  2303.         bra    window_handling_loop
  2304.  
  2305. obfix_resource:    lea    resource_file-data(a4),a3
  2306.  
  2307. *start by relocating all the object trees...
  2308.  
  2309. *
  2310. * I know this is dirty, so don't tell me
  2311. *
  2312.  
  2313.         move.w    18(a3),d7
  2314.  
  2315.         lea    0(a3,d7.w),a0
  2316.  
  2317.         move.l    a0,tree_pointer-bss(a5)
  2318. r_ob_tree_loop:
  2319.         move.l    (a0),d0
  2320.         beq.s    done_tree_r
  2321.  
  2322.         add.l    a3,d0
  2323.         move.l    d0,(a0)+
  2324.         bra.s    r_ob_tree_loop        
  2325. done_tree_r:
  2326.         lea    0(a3,d7.w),a2
  2327.         lea    top_end_at_buf-4-bss(a5),a1
  2328.         lea    default_list-2-bss(a5),a0
  2329.  
  2330. r_trees:    move.l    (a2)+,d6
  2331.         bne    no_end_of_reloc
  2332.         rts
  2333.  
  2334. no_end_of_reloc:
  2335.         sub.l    a3,d6
  2336.  
  2337.         tst.w    (a0)+
  2338.         move.w    #-1,(a0)
  2339.  
  2340.         moveq    #0,d4
  2341.         move.w    2(a3),d4
  2342.         sub.l    d4,d6
  2343.         divu    #24,d6
  2344.  
  2345.         move.l    #"WtP!",(a1)
  2346.  
  2347.         moveq    #0,d5
  2348. *        move.w    (a3),d5        
  2349.  
  2350.         move.w    #"åt",-(sp)
  2351.         move.w    d5,-(sp)
  2352.         bra    jump_out
  2353.  
  2354. r_tree_loop:    move.w    d5,d0
  2355.         add.w    d6,d0
  2356.  
  2357. *        sub.w    (a3),d0
  2358.         mulu    #24,d0
  2359.         
  2360.         add.w    2(a3),d0
  2361.  
  2362.         moveq    #0,d1
  2363.         moveq    #0,d2
  2364.  
  2365.         move.b    17(a3,d0.w),d1
  2366.         mulu    char_width-bss(a5),d1
  2367.         move.b    16(a3,d0.w),d2
  2368.  
  2369.         add.l    d2,d1
  2370.  
  2371.         move.w    d1,16(a3,d0.w)
  2372.  
  2373.         moveq    #0,d1
  2374.         moveq    #0,d2
  2375.  
  2376.         move.b    19(a3,d0.w),d1
  2377.         mulu    char_heigth-bss(a5),d1
  2378.         move.b    18(a3,d0.w),d2
  2379.  
  2380.         add.l    d2,d1
  2381.         move.w    d1,18(a3,d0.w)
  2382.  
  2383.         moveq    #0,d1
  2384.         moveq    #0,d2
  2385.  
  2386.         move.b    21(a3,d0.w),d1
  2387.         mulu    char_width-bss(a5),d1
  2388.         move.b    20(a3,d0.w),d2
  2389.         add.l    d2,d1
  2390.         move.w    d1,20(a3,d0.w)
  2391.  
  2392.         moveq    #0,d1
  2393.         moveq    #0,d2
  2394.  
  2395.         move.b    23(a3,d0.w),d1
  2396.         mulu    char_heigth-bss(a5),d1
  2397.         move.b    22(a3,d0.w),d2
  2398.         add.l    d2,d1
  2399.         move.w    d1,22(a3,d0.w)
  2400.  
  2401.         move.w    8(a3,d0.w),d1
  2402.         and.w    #7,d1
  2403.         cmp.w    #7,d1
  2404.         bne.s    not_default
  2405.  
  2406.         move.w    d5,(a0)
  2407. not_default:
  2408.         move.w    6(a3,d0.w),d1
  2409.  
  2410.         move.l    a0,-(sp)
  2411.         bsr    relocate_object
  2412.         move.l    (sp)+,a0
  2413.  
  2414.         cmp.w    (a1),d5
  2415.         bne    not_last_child
  2416.  
  2417.         tst.w    (a1)+
  2418.         bra.s    end_of_chain
  2419.  
  2420. not_last_child:    move.w    0(a3,d0.w),d1
  2421.         bmi    end_of_chain
  2422.  
  2423.         move.w    d1,-(sp)
  2424.  
  2425. end_of_chain:    move.w    2(a3,d0.w),d1
  2426.         bmi    no_children
  2427.         
  2428.         move.w    d1,-(sp)
  2429.         move.w    4(a3,d0.w),-(a1)
  2430. no_children:
  2431.  
  2432. jump_out:    move.w    (sp)+,d5
  2433.  
  2434.         cmp.w    #"åt",d5
  2435.         beq    r_trees
  2436.  
  2437.         bra    r_tree_loop
  2438.  
  2439. relocate_object:
  2440.         cmp.w    #20,d1
  2441.         beq    no_relocate_object
  2442.  
  2443.         cmp.w    #25,d1
  2444.         beq    no_relocate_object
  2445. r
  2446.         cmp.w    #27,d1
  2447.         beq    no_relocate_object
  2448.  
  2449.         move.l    a3,d2
  2450.         add.l    d2,12(a3,d0.w)
  2451.  
  2452.         move.l    12(a3,d0.w),a0
  2453.  
  2454.         cmp.w    #21,d1
  2455.         beq    relocate_tedinfo
  2456.  
  2457.         cmp.w    #22,d1
  2458.         beq    relocate_tedinfo
  2459.  
  2460.         cmp.w    #23,d1
  2461.         beq    relocate_bitblk
  2462.  
  2463.         cmp.w    #24,d1
  2464.         beq    relocate_applblk
  2465.  
  2466.         cmp.w    #29,d1
  2467.         beq    relocate_tedinfo
  2468.  
  2469.         cmp.w    #30,d1
  2470.         beq    relocate_tedinfo
  2471.  
  2472.         cmp.w    #31,d1
  2473.         beq    relocate_iconblk
  2474.  
  2475. no_relocate_object:
  2476.         rts
  2477.  
  2478. relocate_tedinfo:
  2479.         add.l    d2,(a0)
  2480.         add.l    d2,4(a0)
  2481.         add.l    d2,8(a0)
  2482.         rts    
  2483.  
  2484. relocate_iconblk:
  2485.         add.l    d2,(a0)
  2486.         add.l    d2,4(a0)
  2487.         add.l    d2,8(a0)
  2488.         rts    
  2489.  
  2490. relocate_bitblk:
  2491.         add.l    d2,(a0)
  2492.         rts    
  2493.  
  2494. relocate_applblk:
  2495.         add.l    d2,(a0)
  2496.         rts    
  2497.  
  2498. check_rezf:    tst.w    loaded_rezf-bss(a5)
  2499.         bne.s    return_from_crf
  2500.  
  2501.         bsr    get_cookie
  2502.  
  2503.         tst.l    text_adr-bss(a5)
  2504.         beq.s    return_from_crf
  2505.  
  2506.         move.w    #2,loaded_rezf-bss(a5)
  2507.  
  2508.         move.l    tree_pointer-bss(a5),a0
  2509.         move.l    editfile*4(a0),a0
  2510.  
  2511.         lea    edit_mem*24+8(a0),a0
  2512.  
  2513.         move.l    org_status_emb-bss(a5),(a0)
  2514.  
  2515.         move.l    tree_pointer-bss(a5),a0
  2516.         move.l    menu*4(a0),a0
  2517.  
  2518.         move.w    #edit_mem_menu,d0
  2519.         moveq    #1,d1
  2520.  
  2521.         bsr    menu_enable
  2522.  
  2523.         move.l    tree_pointer-bss(a5),a0
  2524.         move.l    menu*4(a0),a0
  2525.  
  2526.         move.w    #reset_menu,d0
  2527.         moveq    #1,d1
  2528.  
  2529.         bsr    menu_enable
  2530.  
  2531.         move.l    text_adr-bss(a5),a0
  2532.         move.l    2(a0),save_mem-bss(a5)    *save got and fool to
  2533. return_from_crf:
  2534.         rts
  2535.  
  2536. get_cookie:    pea    hunt_cookie(pc)
  2537.         move.w    #38,-(sp)
  2538.         trap    #14
  2539.         addq.l    #6,sp
  2540.  
  2541.         tst.l    d0
  2542.         bmi    cookie_not_found
  2543.  
  2544.         move.l    d0,text_adr-bss(a5)
  2545. cookie_not_found:
  2546.         rts
  2547.  
  2548. hunt_cookie:    movem.l d1-d2/a0,-(sp)
  2549.  
  2550.         move.l    #"RTFW",d2
  2551.  
  2552.         move.l    $5a0.w,d0
  2553.         beq.s    no_jar
  2554.  
  2555.         move.l    d0,a0
  2556.  
  2557. look_for_cookie:
  2558.         move.l    (a0)+,d1
  2559.         move.l    (a0)+,d0
  2560.  
  2561.         cmp.l    d2,d1
  2562.         beq.s    found_cookie
  2563.  
  2564.         tst.l    d1
  2565.         bne.s    look_for_cookie
  2566.  
  2567. no_jar:        moveq    #-1,d0
  2568. found_cookie:    movem.l    (sp)+,d1-d2/a0
  2569.         rts
  2570.  
  2571. search_command:    move.l    d0,a1            *text to a1
  2572.  
  2573.         lea    $80(a6),a0
  2574.  
  2575.         moveq    #0,d6
  2576.  
  2577.         moveq    #0,d5
  2578.         move.b    (a0)+,d5
  2579.  
  2580.         bra.s    init_search_loop
  2581.  
  2582. search_command_line:
  2583.         move.b    (a0)+,d0
  2584.  
  2585.         bsr    upper
  2586.  
  2587.         btst    #0,d6
  2588.         bne    check_w
  2589.  
  2590.         cmp.b    #"G",d0
  2591.         beq.s    found_got
  2592.  
  2593. check_w:    btst    #1,d6
  2594.         bne    init_search_loop
  2595.  
  2596.         cmp.b    #"W",d0
  2597.         beq.s    found_want
  2598.  
  2599. init_search_loop:
  2600.         cmp.b    #3,d6
  2601.         beq.s    fix_exit_code_asap
  2602.  
  2603.         dbra    d5,search_command_line        
  2604.  
  2605. end_of_it:    cmp.b    #3,d6
  2606.         beq.s    fix_exit_code_asap
  2607.  
  2608.         bra    search_rezfool
  2609.  
  2610.  
  2611.  
  2612.  
  2613.  
  2614. found_got:    or.b    #1,d6
  2615.         move.b    (a0)+,d0
  2616.         and.l    #3,d0
  2617.         move.w    d0,2(a1)
  2618.  
  2619.         dbra    d5,init_search_loop    *fix for dubble read
  2620.         bra.s    end_of_it
  2621.  
  2622. found_want:    or.b    #2,d6
  2623.         move.b    (a0)+,d0
  2624.         and.l    #3,d0
  2625.         move.w    d0,4(a1)
  2626.  
  2627.         dbra    d5,init_search_loop    *fix for dubble read
  2628.         bra.s    end_of_it
  2629.  
  2630. fix_exit_code_asap:
  2631.         move.w    2(a1),d0
  2632.         lsl.w    #8,d0
  2633.         move.b    5(a1),d0
  2634.         bra    quit_right_now
  2635.  
  2636.  
  2637. search_rezfool:    move.l    enviro_adr-bss(a5),d0
  2638.         beq    auto_loaded
  2639.  
  2640.         move.l    d0,a0
  2641.  
  2642.         move.b    (a0)+,d0
  2643.         beq    auto_loaded
  2644.  
  2645.         bsr    upper
  2646.  
  2647.         btst    #0,d6
  2648.         bne    check_w2
  2649.  
  2650.         cmp.b    #"G",d0
  2651.         beq.s    found_got2
  2652.  
  2653. check_w2:    btst    #1,d6
  2654.         bne    check_done_both_gw
  2655.  
  2656.         cmp.b    #"W",d0
  2657.         beq.s    found_want2
  2658.  
  2659. check_done_both_gw:
  2660.         cmp.b    #3,d6
  2661.         beq.s    fix_exit_code_asap
  2662.  
  2663.         bra.s    search_rezfool
  2664.  
  2665. found_got2:    or.b    #1,d6
  2666.         move.b    (a0)+,d0
  2667.         and.l    #3,d0
  2668.         move.w    d0,2(a1)
  2669.         bra.s    search_rezfool
  2670.  
  2671.  
  2672. found_want2:    or.b    #2,d6
  2673.         move.b    (a0)+,d0
  2674.         and.l    #3,d0
  2675.         move.w    d0,4(a1)
  2676.         bra.s    search_rezfool
  2677.  
  2678. check_for_rezfool:
  2679.         move.l    44(a6),a0
  2680.         lea    frez-data(a4),a2
  2681.  
  2682.         bra    search_enviroment
  2683.  
  2684. reset_search:    tst.b    (a0)
  2685.         beq.s    no_rezfool
  2686.  
  2687.         lea    frez-data(a4),a2
  2688.  
  2689. search_enviroment:
  2690.         move.b    (a0)+,d0
  2691.         bsr    upper
  2692.  
  2693.         move.b    (a2)+,d1
  2694.         beq.s    found_rezfool
  2695.  
  2696.         cmp.b    d0,d1
  2697.         beq.s    search_enviroment
  2698.  
  2699. find_end_of_cur_var:
  2700.         tst.b    d0
  2701.         beq.s    reset_search
  2702.  
  2703.         move.b    (a0)+,d0
  2704.         bra.s    find_end_of_cur_var
  2705.  
  2706. found_rezfool:    subq.l    #1,a0
  2707.         move.l    a0,enviro_adr-bss(a5)
  2708. no_rezfool:
  2709.         rts
  2710.  
  2711. *
  2712. * Converts a to A
  2713. *
  2714.  
  2715. upper:        cmp.b    #"a",d0
  2716.         bmi    ret_upper
  2717.  
  2718.         cmp.b    #"z",d0
  2719.         bgt    ret_upper
  2720.  
  2721.         sub.b    #$20,d0
  2722.  
  2723. ret_upper:    rts
  2724.  
  2725.  
  2726.         data
  2727.  
  2728.  
  2729.  
  2730.  
  2731. *
  2732. * {value from cookie}+2; got
  2733. *                    +4; want
  2734.  
  2735.         even
  2736. data:
  2737.  
  2738. no_auto_run:    dc.b    $1b,"E","Rez Fooler currently cannot be loaded (w/",$0a,$0d
  2739.         dc.b    "interaction) from the \AUTO folder, try loading",$0a,$0d
  2740.         dc.b    "from desktop (or your standard shell) instead!",$0a,$0d
  2741.         dc.b    $0a,$0d,7,0
  2742.  
  2743.         even
  2744.  
  2745.  
  2746. *                01234567890123 123456789012
  2747. where_is:        dc.b    "Where is the",0
  2748.         even
  2749. rez_fooler_t:        dc.b    "Rez Fooler ?",0
  2750.         even
  2751. decode_table:    dc.w    3,1,2,0
  2752.         even
  2753. window_name:    dc.b    "Rez Fooler Control 1.0",0,0,0,0,0,0
  2754.         even
  2755. acc_name:    dc.b    "  RF Control",0
  2756.         even
  2757. frez:        dc.b    "REZFOOL=",0
  2758.         even
  2759. resource_file:    incbin    "D:\rzf\rez_foo2.rsc"
  2760.         even
  2761.  
  2762.         dc.l    0
  2763.  
  2764.         bss
  2765. bss:
  2766.  
  2767. aes_pb:        ds.l    6
  2768. vdi_pb:        ds.l    5
  2769.  
  2770. aes_control:
  2771. aes_opcode:    ds.w    1                *command #
  2772. aes_sintin:    ds.w    1                *size of intin array, bytes
  2773. aes_sintout:    ds.w    1                *size of intout array, bytes
  2774. aes_saddrin:    ds.w    1                *size of addrin array, longs
  2775. aes_saddrout:    ds.w    1                *size of addrout array, longs
  2776.  
  2777. vdi_control:
  2778. vdi_opcode:    ds.w    1
  2779. vdi_sptsin:    ds.w    1
  2780. vdi_sptsout:    ds.w    1
  2781. vdi_sintin:    ds.w    1
  2782. vdi_sintout:    ds.w    1
  2783. vdi_subfunct:    ds.w    1
  2784. vdi_device:    ds.w    1
  2785. vdi_cd_1:    ds.w    1
  2786. vdi_cd_2:    ds.w    1
  2787. vdi_cd_3:    ds.w    1
  2788. vdi_cd_4:    ds.w    1
  2789. vdi_cd_5:    ds.w    1
  2790.  
  2791. aes_global:
  2792. aes_version:    ds.w    1
  2793. aes_count:    ds.w    1
  2794. aes_id:        ds.w    1
  2795. aes_private:    ds.l    1
  2796. aes_tree:    ds.l    1
  2797. aes_resv1:    ds.l    1
  2798. aes_resv2:    ds.l    1
  2799. aes_resv3:    ds.l    1
  2800. aes_resv4:    ds.l    1
  2801.  
  2802. intin:        ds.w    256
  2803. intout:        ds.w    256
  2804. ptsin:        ds.w    256
  2805. ptsout:        ds.w    256
  2806. addrin:        ds.l    128
  2807. addrout:    ds.l    128
  2808.  
  2809. graf_h:        ds.w    1
  2810. appl_id:    ds.w    1
  2811. window_handle:    ds.w    1
  2812. window_x:    ds.w    1
  2813. window_y:    ds.w    1
  2814. window_w:    ds.w    1
  2815. window_h:    ds.w    1
  2816. work_x:        ds.w    1
  2817. work_y:        ds.w    1
  2818. work_w:        ds.w    1
  2819. work_h:        ds.w    1
  2820.  
  2821. dta:        ds.b    64
  2822. filename:    ds.b    16
  2823. path:        ds.b    128+12
  2824.  
  2825. em_buffer:    ds.w    256
  2826. workout:    ds.w    58
  2827. char_width:    ds.w    1
  2828. char_heigth:    ds.w    1
  2829. rcs_screen:    ds.l    1
  2830. tree_pointer:    ds.l    1
  2831. info_temp:    ds.l    1
  2832. text_adr:    ds.l    1
  2833. save_mem:    ds.l    1
  2834. got_file:    ds.w    1
  2835. want_file:    ds.w    1
  2836. enviro_adr:    ds.l    1
  2837. decode_fw:    ds.l    1
  2838. file_handle:    ds.w    1
  2839. safety_check:    ds.w    1
  2840. acc_load:    ds.w    1
  2841. desk_id:    ds.w    1
  2842. default_list:    ds.w    32
  2843. org_status_emb:    ds.l    1
  2844. loaded_rezf:    ds.w    1
  2845.         ds.w    64
  2846. top_end_at_buf:    ds.w    1
  2847.  
  2848.         ds.l    1024
  2849. stack:        ds.l    1
  2850.         end
  2851.